Home >Backend Development >PHP Tutorial >N Tips for PHP
N Tips for PHP.
XML
Convert xml string to array?
We all know that converting json into an array is json_decode(str,false)
, but what about converting XML strings? (XML is gradually becoming unpopular)
A common practice on the Internet is:
<code>$array=json_decode(json_encode(simplexml_load_string($xmlstring)),true);` </code>
Isn’t it a bit hehe? This is PHP.
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });The above has introduced the N tips of PHP, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.