PHP How do I properly check if an array is multi-dimensional - strange array behavior
- by niggles
If I have this array:
$foo[0] = 'bar';
$foo[1] = 'bar bar';
echo $foo[0][1];
// result
a
// i.e the second letter of 'bar'
I want to check that $foo[0][1] is not set i.e if I had:
$foo[0][1] = 'bar';
it would evaluate to true, but in my original example of $foo[0] = 'bar' I would expect that:
isset($foo[0][1])
would return false;
What's the correct way to test that please.