hakopako

Full-stack Engineer's blog

xml

"simplexml_load_string" throws an error - how to catch it -

日本語 | English Loading xml data with just one line like below would bring a few troubles in php, even though it returns "false" when failed. $xml = simplexml_load_string($data); because ... Loading xml that contains control characters wi…