如何在一个PHP里把{"song":[{"title":"ht1","picture":"ht2","artist":"ht3","url":"ht4"}]}转换成{"title":"ht1","picture":"ht2","artist":"ht3","url":"ht4"}并显示出来,求一段可运行的完整代码,感激不尽!
<?php
$s='{"song":[{"title":"ht1","picture":"ht2","artist":"ht3","url":"ht4"}]}';
$o=json_decode($s,true);
$o=$o["song"][0];
echo(json_encode($o))."<br>";
echo $o["title"];
?>