PHP cannot access object in array

Argentos97

New Member
in my application i get returned an array of objects and i am trying to access to access the object inside the array like this \[code\]$array[0]->name\[/code\] but it doesn't work for some reason ,i tried to access it like this - \[code\]$var = $array[0]; $var->name\[/code\] and it shows me this error > \[code\]Trying to get property of non-object\[/code\]whats going on here ? why i cant access the object ? and how can i access it ? also , would be better if i just got a multidimensional array instead array of objects?var_dump://\[code\]array(2) { [0]=> object(stdClass)#16 (9) { ["id"]=> string(1) "1" ["name"]=> string(27) "
 
Back
Top