end和array_pop 有什么区别?解决方法

WBOY
Release: 2016-06-13 13:34:20
Original
920 people have browsed it

end和array_pop 有什么区别?
end和array_pop 有什么区别?

end ― 将数组的内部指针指向最后一个单元 
array_pop ― 将数组最后一个单元弹出(出栈)

这两个函数的区别到底在哪里?

------解决方案--------------------
$a=end($array) 可以理解为取最后一个单元的内容
array_pop($array) 可以理解为删除最后一个单元
------解决方案--------------------
你不是都知道了吗?
将数组最后一个单元弹出 后,数组不就少了一个元素吗?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template