Se connecter / S'enregistrer
Votre question

JSON et php

Tags :
  • Programmation
Dernière réponse : dans Programmation
21 Février 2009 21:26:35

Bonsoir,
comment exploiter ce genre d'array en php :

  1. var win_json_data = {"query":"Kylie Minogue","data":[{"file_url":"http:\/\/wemu.ru\/wp-content\/uploads\/2007\/10\/kylie_minogue_-_2_hearts.mp3","file_name":"kylie_minogue_-_2_hearts","page_url":"http:\/\/blogus.ru\/tagposts.aspx?id=Kylie+Minogue","artist":"Kylie Minogue","album":"","title":"2 Hearts","genre":"","year":"0","bitrate":"192000","playtime":"00:02:51","playtime_sec":"171","filesize":"4118528","fileformat":"mp3"},{"file_url":"http:\/\/aeroplano.org\/syntheticrocks\/kylie_minogue_vs._new_order-cant_get_blue_monday_out_of_my_head.mp3","file_name":"kylie_minogue_vs._new_order-cant_get_blue_monday_out_of_my_head","page_url":"http:\/\/syntheticrocks.blogspot.com\/","artist":"Kylie Minogue Vs. New Order","album":"The Best Club Anthems Classics","title":"Can't Get Blue Monday Out Of My Head","genre":"Dance","year":"2005","bitrate":"202432","playtime":"00:04:01","playtime_sec":"241","filesize":"6142667","fileformat":"mp3"},{"file_url":"http:\/\/depo.bluetone.cz\/download\/MAZ7obSQ\/kylie-minogue---in-my-arms-(popstar%5c-s-extended-mix).mp3","file_name":"kylie-minogue---in-my-arms-(popstar%5c-s-extended-mix)","page_url":"http:\/\/depo.bluetone.cz\/download\/MAZ7obSQ\/","artist":"Kylie Minogue","album":"<a href="http://www.djwitek.prv.pl" rel="nofollow" target="_blank">www.djwitek.prv.pl</a>","title":"In My Arms (Popstar's Extended Mix) <a href="http://www.djwitek.prv.pl" rel="nofollow" target="_blank">www.djwitek.prv.pl</a>","genre":"<a href="http://www.djwitek.prv.pl" rel="nofollow" target="_blank">www.djwitek.prv.pl</a>","year":"2008","bitrate":"128000","playtime":"00:05:02","playtime_sec":"302","filesize":"4845568","fileformat":"mp3"},{"file_url":"http:\/\/musicwarship.com\/wp-content\/uploads\/2008\/05\/kylie_minogue_-_slow_-_01_slow.mp3","file_name":"kylie_minogue_-_slow_-_01_slow","page_url":"http:\/\/besttuna.blogspot.com\/search?updated-max=2008-08-11T21%3A24%3A00%2B01%3A00","artist":"Kylie Minogue","album":"Slow","title":"Slow","genre":"Dance","year":"2003","bitrate":"192000","playtime":"00:03:15","playtime_sec":"195","filesize":"4688000","fileformat":"mp3"},{"file_url":"http:\/\/crimea-board.info\/temp\/RELAX\/Kylie%20Minogue%20-%20Confide%20In%20Me.mp3","file_name":"Kylie%20Minogue%20-%20Confide%20In%20Me","page_url":"http:\/\/crimea-board.info\/temp\/RELAX\/","artist":"Kylie Minogue","album":"Ultimate Kylie (Special Edition) (Cd 2)","title":"Confide In Me","genre":"Pop","year":"2006","bitrate":"226849","playtime":"00:04:27","playtime_sec":"267","filesize":"7565406","fileformat":"mp3"},{"file_url":"http:\/\/musicwarship.com\/wp-content\/uploads\/2008\/05\/kylie_minogue_-_slow_-_01_slow.mp3","file_name":"kylie_minogue_-_slow_-_01_slow","page_url":"http:\/\/tagoo.ru\/search.php?search=slow&adv=1","artist":"Kylie Minogue","album":"Slow","title":"Slow","genre":"Dance","year":"2003","bitrate":"192000","playtime":"00:03:15","playtime_sec":"195","filesize":"4688000","fileformat":"mp3"},{"file_url":"http:\/\/infotainmentworld.com\/music\/White-Diamond\/01-kylie_minogue-white_diamond.mp3","file_name":"01-kylie_minogue-white_diamond","page_url":"http:\/\/infotainmentworld.com\/MoreMusic.htm","artist":"Kylie Minogue","album":"X","title":"White Diamond (Photo Gallery Background)","genre":"Pop","year":"2007","bitrate":"158075","playtime":"00:02:50","playtime_sec":"170","filesize":"3354489","fileformat":"mp3"},{"file_url":"http:\/\/volkman.ucoz.ru\/Musiqi\/kylie_minogue_-_the_one.mp3","file_name":"kylie_minogue_-_the_one","page_url":"http:\/\/qardaban.com\/news\/2008-09-29-910","artist":"Kylie Minogue | <a href="wWw.Qardaban.com" rel="nofollow" target="_blank">wWw.Qardaban.com</a> |","album":"X","title":"The one | <a href="wWw.Qardaban.com" rel="nofollow" target="_blank">wWw.Qardaban.com</a> |","genre":"Pop","year":"2008","bitrate":"201602","playtime":"00:04:05","playtime_sec":"245","filesize":"6174720","fileformat":"mp3"},{"file_url":"http:\/\/files.li.ru\/mp3\/Gordeew\/World_Chart_Hits\/Kylie_Minogue_-_Chocolate.mp3","file_name":"Kylie_Minogue_-_Chocolate","page_url":"http:\/\/files.li.ru\/mp3\/Gordeew\/World_Chart_Hits\/?asc=date","artist":"Kylie Minogue","album":"WorldChartHits <a href="http://www.radioexpress.com" rel="nofollow" target="_blank">www.radioexpress.com</a>","title":"Chocolate","genre":"Top 40","year":"2004","bitrate":"192000","playtime":"00:05:01","playtime_sec":"301","filesize":"7220949","fileformat":"mp3"},{"file_url":"http:\/\/files.li.ru\/mp3\/Gordeew\/Hits\/0227\/Kylie_Minogue-Red_Blooded_Woman.mp3","file_name":"Kylie_Minogue-Red_Blooded_Woman","page_url":"http:\/\/files.li.ru\/mp3\/Gordeew\/Hits\/0227\/?asc=size","artist":"Kylie Minogue","album":"Body Language","title":"Red Blooded Woman","genre":"Blues","year":"2003","bitrate":"192000","playtime":"00:04:22","playtime_sec":"262","filesize":"6282680","fileformat":"mp3"}],"total":100,"on_page":10,"last_sid":110243}


Merci d'avance.

Autres pages sur : json php

21 Février 2009 21:47:32

A priori, le plus simple est : http://www.php.net/json_decode

Si ton php a ces fonctions, ce qui est le cas pour les verison supérieures a la 5.2.x.
m
0
l
Tom's guide dans le monde
  • Allemagne
  • Italie
  • Irlande
  • Royaume Uni
  • Etats Unis
Suivre Tom's Guide
Inscrivez-vous à la Newsletter
  • ajouter à twitter
  • ajouter à facebook
  • ajouter un flux RSS