我有数组:
数组:
Array
(
[0] => Array
(
[name] => point
[visibility] =>
)
[1] => Array
(
[name] => php_first_table
[visibility] => 1
)
[2] => Array
(
[name] => ohz
[visibility] => 1
)
)
现在我想找到并删除元素name=ohz
:
for($i=0;$i<count($arrays);$i++){
if(array_search("ohz",$arrays[$i])){
unset($arrays[$i]);
}
}
print_r($arrays);
输出:
Array
(
[0] => Array
(
[name] => point
[visibility] =>
)
[2] => Array
(
[name] => ohz
[visibility] => 1
)
)
为什么php_first_table
没有ohz
被删除?