Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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;

}
 
PREVIOUS NEXT
Tagged: #php #xml #array
ADD COMMENT
Topic
Name
5+3 =