Answers for "convert string to xml php"

PHP
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
0

php object to xml

<?php
$array = array('hello' => 'world', 'good' => 'morning');

$xml = simplexml_load_string("<?xml version='1.0' encoding='utf-8'?><foo />");
foreach ($array as $k=>$v) {
  $xml->addChild($k, $v);
}
?>
Posted by: Guest on July-04-2021

Browse Popular Code Answers by Language