Deleting an element in an array is the most common. Today I will briefly introduce how to delete the last element. If you want to delete any element in the array, you can use my second method and add an if ( ){ unset()} can be achieved.
Example
The code is as follows
|
Copy code
|
||||
$stack = array("orange", "banana", "apple", "raspberry"); $fruit = array_pop($stack); print_r($stack);
[0] => orange source:php.cn
Previous article:PHP pagination can use tables to paginate classes_PHP tutorial
Next article:Multiple ways to get file extensions in php_PHP tutorial
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
Latest Articles by Author
Latest Issues
When adding sublime3 to compile system php, use the PHP toolbox, cmd php -v is useless
From 1970-01-01 08:00:00
0
0
0
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|