|
Posted by Leon Vismer on 08/10/05 23:21
Hi Marco
To awnser you question I do not know why it is excluded from the default
decode array. Maybe it could be that these are multibyte characters (any
takers)?
You can get a list of the entities that are changed
$trans = get_html_translation_table(HTML_ENTITIES);
echo"<pre>";print_r($trans);echo"</pre>";
to add some extras as you have below, use something similar to
function htmldecode($string)
{
$trans = get_html_translation_table(HTML_ENTITIES);
$trans[chr(0xe2).chr(0x80).chr(0xa6)] = '…';
$trans = array_flip($trans);
return strtr($string, $trans);
}
$string = "…&";
echo htmldecode($string) ."\n";
Note: obviously hex e2 80 a6 make up the hellip chars.
Hope this helps
Cheers
--
Leon
On Wednesday 10 August 2005 20:55, Marco wrote:
> I tried using html_entity_decode () but why won't these characters decode:
>
> ’
> –
> …
> “
> ”
Navigation:
[Reply to this message]
|