Sometimes it looks like an array, but it can be a printed string of the array ... - This happens to the best of us ...
Or, in any case, check that your array is an array. I know this sounds silly, but sometimes after many hours of screen time, mistakes are made.
<?php $MyArray = array('0' => 'this','1' => 'is','2' => 'an array'); echo is_array($MyArray) ? 'It Is an Array' : 'not an Array'; ?>
This will lead to the conclusion: this is an array.
Shlomtzion
source share