1. 自己写for循环 从array里去掉$tmp这个元素的值 <?php $tmp = '324'; $arr = array( '0' => '321', '1' => '322', '2' => '323', '3' => '324', '4' => '325', '5' => '326', ); 代码 foreach( $arr as $k=>$v) { if($tmp == $v) unset($arr[$k]); } print_r($arr); ?> 此时 Array ( [0] => 321 [1] => 322 [2] => 323 [4] =>