Mig*_*ork -4 php arrays
我想在PHP中获取数组的最后一个元素.
我经常这样做:
$last = $this->array_of_stuff[count($this->array_of_stuff) - 1];
不过我对此并不满意.
有什么方法可以缩短语法并避免重复代码?
Geo*_*ili 6
您可以end在这种情况下使用函数. 请参阅手册
end
end($array)
归档时间:
11 年,3 月 前
查看次数:
195 次
最近记录: