Sorry for asking a basic question like this but I've been reading on this for a few hours now and the examples aren't making sense to me in context of the way my array is.. I have been able to pass this from my server side (cakephp) to the javascript (I'm using jquery) but after that, I am lost as to how to make use of the data.. I tried just showing it using an alert, but it gives output like "object Object" and thats all..
This is an example array that I have:
Array (
[0] => Array ( [Uiemail] => Array ( [uiemail_id] => 2 [divid] => upd1 [width] => 200 [height] => 200 [leftpos] => 122 [toppos] => 122 [cssgroup] => 1 [colortop] => [colorbottom] => [colorborder] => [borderwidth] => [zindex] => ) )
[1] => Array ( [Uiemail] => Array ( [uiemail_id] => 3 [divid] => upd2 [width] => 200 [height] => 200 [leftpos] => 333 [toppos] => 444 [cssgroup] => 1 [colortop] => [colorbottom] => [colorborder] => [borderwidth] => [zindex] => ) )
[2] => Array ( [Uiemail] => Array ( [uiemail_id] => 4 [divid] => upd3 [width] => 200 [height] => 200 [leftpos] => 555 [toppos] => 466 [cssgroup] => 1 [colortop] => [colorbottom] => [colorborder] => [borderwidth] => [zindex] => ) )
)
EDIT:
The array is the way it is as its the output from a Cakephp database GET (cakephp's equivalent of this).
It has 3 arrays, the first is the "parent array" and contains the [1], [2], [3] which are like an auto-increment ID for the 2nd tier arrays.
The 2nd tier has an array that holds the 3rd, this second doesn't really contain any data other than the 3rd array (its done like this by cakephp since its representing the database table)
So, the 3rd tier array has all the data that I need, however I also would want to use the first tier ID
IN PHP A INDIVIDUAL PIECE OF DATA FROM THIS ARRAY IS ACCESSED AS SUCH:
$arrayline = [0]['Uiemail']['toppos'];
Here is some javascript I tried that didn't work (json is array name):
$(json).each(function() {
alert(this.text)
});
});
Thanks for any advice, its just that my array is a nested array (as its from a database call) and it seems most examples don't go this deep which is leading me to confusion.