Hello,
Sorry if my title is hard to understand. Let me explain.
To use this example of my structure:
Array
(
[2] => Array
(
[0] => stdClass Object
(
[category_id] => 2
[category_name] => women
[project_id] => 1
[project_name] => Balloons
)
)
[1] => Array
(
[0] => stdClass Object
(
[category_id] => 1
[category_name] => men
[project_id] => 2
[project_name] => Cars
)
[1] => stdClass Object
(
[category_id] => 1
[category_name] => men
[project_id] => 3
[project_name] => Houses
)
)
Then once i have that, i send it out to be eval'd by javascript(which is successful). Console.log does in fact shows that's my eval'd json is in fact now an object.
Now, If i console.log(myArray[2]), it will show it as an array that contains another array. Which is also correct
BUT!.. if i try to do this:
for (item in myArray[2]) {
...
}
or this:
newVar = myArray[2]
for (item in newVar) {
...
}
"item" doesn't contain the array as it should. it contains a string equal the sub arrays' key. Which in this case is "0"
What am I missing here guys? :(
Thanks for the help!