这是我的代码
$value = ["300","200","400","500"];
$remove = "300";
我希望$value
为["200","400","500"];
请回答此问题
答案 0 :(得分:4)
您可以使用array_shift()
,因为它会删除数组中的第一项:
$value = ["300","200","400","500"];
$remove = array_shift($value);
print_r($value);
这将返回:
Array
(
[0] => 200
[1] => 400
[2] => 500
)