I have a very complicated array, and i want to convert it into a PHP valid array so i can loop through the values.
JS array:
$test = ( // Portraits
{'image'=> 'http://farm8.staticflickr.com/7319/8993158058_f82968e61a_b.jpg', 'thumb'=> 'http://farm8.staticflickr.com/7319/8993158058_f82968e61a_t.jpg'},
{'image'=> 'http://farm3.staticflickr.com/2891/8993155214_b8e091c625_b.jpg', 'thumb'=> 'http://farm3.staticflickr.com/2891/8993155214_b8e091c625_t.jpg'},
{'image'=> 'http://farm8.staticflickr.com/7432/8993133146_d647438c55_b.jpg', 'thumb'=> 'http://farm8.staticflickr.com/7432/8993133146_d647438c55_t.jpg'});
EDIT
PHP loop: it should the image part for every value
for ($i = 0;$i < $test.length;$i++){
saveToDisk($test[$i]['image'],$i);
}
Is the above correct? how can i read through the values?
{and}with[and]you hafve valid php short array notation, if you swap=>with:it looks like valid JSON.strinifyyour Javascript object in order to be able to use json_decode on it.