Code: Select all
Bill Clinton, George W. Bush, and Tony Blair. The setting was elegant—the.Code: Select all
 Code: Select all
—Code: Select all
$decode = htmlspecialchars_decode($final);Moderator: General Moderators
Code: Select all
Bill Clinton, George W. Bush, and Tony Blair. The setting was elegant—the.Code: Select all
 Code: Select all
—Code: Select all
$decode = htmlspecialchars_decode($final);Thank you for reply. Unfortunately, my problem was not solved.requinix wrote:htmlspecialchars_decode() only reverses what htmlspecialchars() could do: less-than, greater-than, and quotes. You want html_entity_decode.
Code: Select all
$url = @file_get_contents('http://some.address.com');
$start = strstr($url, '<body>');
$end = substr($start, 0, strpos($start, '</body>'));
$remove_tags = strip_tags($end);
$remove_spaces = preg_replace('/\s+/', ' ', $remove_tags);
$text = html_entity_decode($remove_spaces);
var_dump($text);Code: Select all
Clinton’s presidency Clinton’s . “TheCode: Select all
$text = html_entity_decode($remove_spaces, ENT_QUOTES, "UTF-8");Many thanks!requinix wrote:You need to specify an encoding that can support the characters you're trying to decode. Like UTF-8.Code: Select all
$text = html_entity_decode($remove_spaces, ENT_QUOTES, "UTF-8");