подскажите как решить проблему:
PHP code
<?php
# Получаем данные
$q = file_get_contents('http://host.fm/api.php?service=Radio.getPlaylist&radio=17676&perpage=5&format =JSON');
# Декодируем JSON. В итоге мы получим набор объектов с данными.
$q = json_decode($q);
# Выводим результат на экран
echo '<pre>';
settype($q, 'array');
print_r($q);
echo '</pre>';
?>
Сам масив
Array
(
[playlist] => stdClass Object
(
[pages] => stdClass Object
(
[page] => 1
[count] => 687
)
[tracks] => stdClass Object
(
[perpage] => 5
[count] => 3431
[from] => 0
[to] => 5
[list] => Array
(
[0] => stdClass Object
(
[track] => stdClass Object
(
[title] => Club live 2011
[artist] => Dj Samp
[votes] => 0
[time] => 01:22, 25.12.2012
[timestamp] => 1356384140
)
)
[1] => stdClass Object
(
[track] => stdClass Object
(
[title] => Buss 2009
[artist] => Dj Samp
[votes] => 0
[time] => 01:18, 25.12.2012
[timestamp] => 1356383898
)
)
[2] => stdClass Object
(
[track] => stdClass Object
(
[title] => ???????
[artist] => dj Neonilin
[votes] => 0
[cover] => http://host.fm/storage/artists/3948/3aec9bced3f7f56dc85774ee4cb1f2ed.jpg
[time] => 01:14, 25.12.2012
[timestamp] => 1356383659
)
)
[3] => stdClass Object
(
[track] => stdClass Object
(
[title] => ???????!
[artist] => Dj Max
[votes] => 0
[time] => 01:08, 25.12.2012
[timestamp] => 1356383303
)
)
[4] => stdClass Object
(
[track] => stdClass Object
(
[title] => Poison Marco Van Bassken RemixDJ Gollum Feat Scarlet
[artist] => dj gollum feat scarlet
[votes] => 0
[time] => 01:04, 25.12.2012
[timestamp] => 1356383058
)
)
)
)
)
)
Хотелось бы добится такого вида:
[Time] Artist - Title (votes)
[01:22, 25.12.2012] Dj Samp - Club live 2011 (0)
Буду благодарен + в репутацию.