Assuming that this array is the return value of ajax and already been evaluated to json.
This is the link on how to do it http://dreamluverz.com/2007/12/12/ajax-and-json/
The {} and [] symbolizes for array
“key” : “value” => ‘:’ colon separates the key and value
var a = {"ids" :[
{"id" : "1", "name" :
["a", "b"]
},
{"id" : "2", "name" :
[ "ab"]
}
]}
for(var d=0; d < a.ids.length; d++){
alert(a.ids[d].id);
for(var p=0; p < a.ids[d].name.length; p++){
alert(a.ids[d].name[p]);
}
}
Imagine that array in this way using php:
$ids[0]['id'] = 1;
$ids[0]['name'] = array(“a”, “b”);
$ids[1]['id'] = 2;
$ids[1]['name'] = array(“a”);
w00t
couldn't you get more ads to this page?
its even more ads then article lol
w00t
couldn't you get more ads to this page?
its even more ads then article lol