I'm having some issues with converting 'html' utf8 charcters to 'xml' style. So, for instance, I want to convert á
because at present, I'm getting the error 'Entity 'aacute' not defined in Entity
' from the DomDocument LoadXML function.
When I do a simple str_replace("á", "á", $xml)
it works, no errors. So, I found a list of special characters are their codes (here
) and built them into a mysql table.
From there, I built two arrays and populated them like so:
$qry=$db->Execute("SELECT * FROM cfg_utf8");
From there, according to the examples given on php.net, I should be able to the same str_replace with the $srch and $fnd arrays to achieve the same result I get when I do it for a one-off. However, it doesn't work. I get the same message as usual whcih makes me think that the str_replace isn't working (as it still mentions 'aacute' which should have been translated).
Can anyone spot where I'm going wrong?