Replace this Hex chars from string in PHP
Posted
by
Guillermo
on Stack Overflow
See other posts from Stack Overflow
or by Guillermo
Published on 2012-04-12T22:55:41Z
Indexed on
2012/04/12
23:29 UTC
Read the original article
Hit count: 514
I'm generating an XML from data that comes from database (and some JSON feeds).
I'm having some problems with some texts that contains some hex chars that are breaking my XML.
For example, see this screenshot of the error I get from Chrome:
I identified the hex characters that are giving me problems (I believe they're called control characters). And these are:
0x03
0x05
0x16
0x0E
How can I replace those characters with PHP before printing them on my XML output?
Thanks!
© Stack Overflow or respective owner