I'm new and I work in php. I have a problem, I have this "array" result from php script (this array was extracted with php of a html page):
Array ( [0] => {"autostart": false,"controls": true,"flashplayer": "/jwplayer7/jwplayer.flash.swf","image": "I NEED THIS", ga: {}, "mute": false, "ph": 1, "preload": "none", "primary": "html", "repeat": false, "skin": { "name": "tube" }, "stagevideo": true, "stretching": "uniform", "visualplaylist": true, "width": "100%", "aspectratio": "16:9", "provider": 'http', "startparam": "start", tracks: [{"file":"I WANT THIS","kind":"thumbnails"}], "sources": [{"file":"I NEED THIS","label":"480p"},{"file":"I NEED THIS","label":"720p"},"I WANT THIS"] ,"logo": {"logoBar": "I NEED THIS", "target": "blank","link": ""},"displaydescription": false,"displaytitle": false , "abouttext": "RapTu Player", "aboutlink": "" } )
I only need the values from image:
, sources:[{"file";}}
but I can't get the values, nothing, I try with javascript:
var str = '<?php echo $jw; ?>';
var json = JSON.parse(str);
var parse = $.parseJSON(file);
$jw
is the variable of the array, and I don't have any result, nothing is printed. Could you help me? (Sorry for my english).
Upgrade: I resolved it using:
object = [<?php echo $jw; ?>]
for(f=0;f<object.length;f++){
}
Thanks everybody!