I\'m trying to parse some HTML that includes some HTML entities, like ×
$str = \' A × B\';
$do
Are you sure the & is being substituted to &
? If that were the case, you'd see the exact entity, as text, not the garbled response you're getting.
My guess is that it is converted to the actual character, and you're viewing the page with a latin1 charset, which does not contain this character, hence the garbled response.
If I render your example, my output is:
fullname: A × B
href: http://example.com/
When viewing this in latin1/iso-8859-1, I see the output you're describing. But when I set the charset to UTF-8, the output is fine.