Answers for "convert xml to array php online"

PHP
4

php xml to array

public function xmlToArray($xmlstring){
    
  $xml = simplexml_load_string($xmlstring, "SimpleXMLElement", LIBXML_NOCDATA);
  $json = json_encode($xml);
  $array = json_decode($json,TRUE);

  return $array;

}
Posted by: Guest on August-25-2020

Code answers related to "convert xml to array php online"

Browse Popular Code Answers by Language