Question : xml to object php
Answered by : rutger
$object = json_decode(json_encode(simplexml_load_string($xml)));
Source : https://www.php.net/manual/en/function.simplexml-load-string.php | Last Update : Thu, 14 May 20
Question : php xml string
Answered by : enrico-bisco
htmlspecialchars($string, ENT_XML1 | ENT_QUOTES, 'UTF-8');// will convert ' to ' in addition to &, <, > and "( not | )
Source : https://stackoverflow.com/questions/3426090/how-do-you-make-strings-xml-safe | Last Update : Fri, 11 Jun 21