i have tried the other posts' explanations i can't get it to work since i always get the following warning: Warning: get_object_vars() expects parameter 1 to be object, array given in ...
The stdclass object array looks like this:
Array
(
[0] => stdClass Object
(
[pares] => 4
[moda] => 9
)
[1] => stdClass Object
(
[pares] => 3
[moda] => 8
)
[2] => stdClass Object
(
[pares] => 2
[moda] => 8
)
[3] => stdClass Object
(
[pares] => 5
[moda] => 4
)
[4] => stdClass Object
(
[pares] => 1
[moda] => 1
)
[5] => stdClass Object
(
[pares] => 6
[moda] => 1
)
)
And i try to access the values - modas and pares and their numbers respectively - for example, the very first element which is "pares" and its value "4" by using, for example
echo get_object_vars($modas_pares)['0']['pares'];
but i get the following warning:
Warning: get_object_vars() expects parameter 1 to be object, array given in
Then how can i access these values?