In php how would I get the value 'error' in this array below? I did a var_dump($myArray);
I tried echo $myArray[0][0]; and $myArray[0]; but neither of these worked.
array(1) {
[0]=>
array(1) {
["error"]=>
array(4) {
["message"]=>
string(27) "Invalid OAuth access token."
["type"]=>
string(14) "OAuthException"
["code"]=>
int(190)
["fbtrace_id"]=>
string(11) "GJb4ZZLyAll"
}
}
}
What I am actually looking for is to check the value of $myArray[0][0]; If my code works that value will be "id". If it didn't work it will be "error". So I need to see if it says "id" or "error".
$myArray[0]['error']['message'];var_dump( array_column($myArray, ''error" ));andvar_dump( array_column($myArray[0], ''error" ));