时间:2021-07-01 10:21:17 帮助过:6人阅读
$arr1 = array (1, 4, 5, 7, 9, 15, 18, 20 ); print_r ( input_array ( $arr1, 5, 6 ) ); function input_array($array, $value, $input) { $key = array_search ( $value, $array ); if ($key !== false) { array_splice ( $array, $key, 1, array ($array [$key], $input ) ); return $array; } return false; }