Im having a problem printing out the values inside a 2d array using echo, it works prefectly using print_r:
print_r($array);
The result of which is :
Array ( [0] => MongoId Object
( [$id] => 57a789b7ce2350b40e000029 ) [1] => MongoId Object
( [$id] => 57a72d35ce2350681200002b ) [2] => 3 )
However when i try to access the values using:
echo $similar[0][1];
//or
echo $similar[0][0];
I get the error : 'Cannot use object of type MongoId as array'
I have also tried different types of loops from here incase the error was triggered by accessing the values specifically by element number, however i got the same error and im unsure why. Any help would be appreciated :)