<?php $json_str='{"x":5,"y":6}'; $obj=json_decode($json_str,true); var_export($obj); /* Resultado: array ( 'x' => 5, 'y' => 6, ) */ ?> DescargarEjecutar código Si su cadena JSON está codificada usando elhtmlentities()ohtmlspecialchars()función, es posible que de...
.</plot><great-lines><line>PHPsolves all my web problems</line></great-lines><ratingtype="thumbs">7</rating><ratingtype="stars">5</rating></movie></movies>XML;$xml=simplexml_load_string($xml_string);$json=json_encode($xml);// convert the XML string to JSONvar_dump($json);?