I'm building a JSON array as follows:
$footerSEOArray[$data['domainname']] = $data[$language];
echo json_encode($footerSEOArray);
Once passed back I decode it like this:
$footerLinks = json_decode($result);
I can print the array as follows:
print_r($footerLinks);
And when printed it looks like this:
stdClass Object
(
[www.data1.com] => Australia
[www.data2.com] => Hindu
[www.data3.com] => Laos
[www.data4.com] => Iranian
[www.data5.com] => America
)
Now I need to be able to print the first and second parts of the array but I can't seem to get it to print outside of the print_r();
thx
$footerLinksis an object. You probably want to get it as array, for which you have to passtrueas second parameter tojson_decode. You can then iterate over the array.