3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlString= '<?xml version="1.0" encoding="UTF-8" ?> <DATA> <playList> <timeStamp>201505261220</timeStamp> <picPlayList> <PlayMode>Sequential</PlayMode> <File>1.jpg</File> <File>10.jpg</File> <File>11.jpg</File> <File>12.jpg</File> <File>13.jpg</File> <File>14.jpg</File> </picPlayList> <videoPlayList> <video> <PlayMode>Sequential</PlayMode> <Screen>FIRST</Screen> <Type>Normal</Type> <File>9423dgg012.mp4</File> <File>letoutong15.mp4</File> <File>fengjing1.mp4</File> <File>fengjing2.mp4</File> <File>fengjing3.mp4</File> </video> <video> <PlayMode>Random</PlayMode> <Screen>SECOND</Screen> <Type>Normal</Type> <File>9423dgg012.mp4</File> <File>letoutong15.mp4</File> <File>fengjing1.mp4</File> <File>fengjing2.mp4</File> <File>fengjing3.mp4</File> </video> </videoPlayList> <HtmlViewList> <PlayMode>Sequential</PlayMode> <Screen>SECOND</Screen> <Type>Normal</Type> <URL>www.lotto-pass.cn/xxx/xxx/xxx</URL> <URL>www.lotto-pass.cn/xxx/xxx/xxx</URL> <URL>www.lotto-pass.cn/xxx/xxx/xxx</URL> <URL>www.lotto-pass.cn/xxx/xxx/xxx</URL> <Refresh>15</Refresh> </HtmlViewList> </playList> </DATA> '; $result_array = $xml_array = json_decode(json_encode(simplexml_load_string($xmlString)), true); echo "\nOutput:\n"; print_r($result_array); echo "\nThe Json output\n"; echo json_encode($result_array); ?>

preferences:
62.15 ms | 407 KiB | 5 Q