gpt4 book ai didi

php - 取消设置数组的最后一项

转载 作者:IT王子 更新时间:2023-10-28 23:56:55 26 4
gpt4 key购买 nike

在这段代码中,我尝试取消设置 $status 数组的第一项和最后一项
取消设置,但我尝试的最后一项将他们的指针放在 $end
not unset 我该怎么办?


$item[$fieldneedle] = " node_os_disk_danger ";
$status = preg_split('/_/',$item[$fieldneedle]);
unset($status[0]);
$end = & end($status);
unset($end);


在这个例子中我需要 os_disk

最佳答案

array_shift($end); //removes first
array_pop($end); //removes last

关于php - 取消设置数组的最后一项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4668997/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com