PHP: XML to Array / Object conversion in one line..
This is the first code snippet that I’d like to share with you.
<?php $object = json_decode(json_encode(simplexml_load_string($xml))); ?>
This will give you a wonderful stdClass object, which you can then turn into an array… Neat isn’t it?
It’s just that I see people writing hundreds lines of code for this…
nice
+1K
Sweet