我知道如何检查数组中的值,但是如何检查数组迭代器中的值?
$array = new ArrayIterator(array(
'1QmRjtsw2UQ' => array('pubdate' => '26 Jun 15', 'alt' => '8 Year Old Beautifully Covers Thinking Out Loud', 'anchor text' => '8-yo \'Thinking Out Loud\''),
'eKqLaYrcf3A' => array('pubdate' => '25 Jun 15', 'alt' => 'Plane Lands On Truck', 'anchor text' => 'Plane Lands On Truck'),
));
我正在尝试检查诸如1QmRjtsw2UQ
.
这不起作用:
if(in_array('1QmRjtsw2UQ', $array));