Answers for "php xml to string"

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
0

xml to object php

$object = json_decode(json_encode(simplexml_load_string($xml)));
Posted by: Guest on May-07-2020
0

php parse xml

$movies = new SimpleXMLElement($xmlstr);

echo $movies->movie[0]->plot;
Posted by: Guest on January-06-2021

Browse Popular Code Answers by Language