which is better expression to make string into xml object[php]? -


which better expression make string xml object[php]?

$xml = new simplexmlelement($xml_string); 

vs

$xml = simplexml_load_string($xml_string); 

same?

they're identical. simplexmlelement::__construct accepts data strings or file paths, if set appropriate options. simplexml_load_file , simplexml_load_string convenience function wrappers amount same thing new simplexmlelement() correct options set.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -