我有一个这样的数组,我试图使用这个数组搜索一个值:
$arr = Array('Slovenly Mexico','Slovenly Europe','Greece');
我正在使用这种条件。请帮忙
if($a[storename] == $arr[$i]){
//some code
}
但它不起作用,因为它作为索引值搜索,所以它给出了一个错误。
Array
(
[0] => Array
(
[storename] => Greece
)
[1] => Array
(
[storename] => Slovenly Europe
)
[3] => Array
(
[storename] => Slovenly Europe
)
[4] => Array
(
[storename] => Greece
)
[5] => Array
(
[storename] => Slovenly Mexico
)
[6] => Array
(
[storename] => Slovenly Europe
)
[7] => Array
(
[storename] => Slovenly Mexico
)
}