search
Homephp教程php手册PHP array_pop() 函数

定义和用法
array_pop() 函数删除数组中的最后一个元素。
语法
array_pop(array)
参数     描述
array     必需。规定输入的数组参数。
例子
$arr = array(
'asp',
'php',
'jsp',
'.net',
'c++'
);

echo '原数组:';
echo '

';<br>
print_r($arr);<br>
echo '
';

$arr_tmp = array_pop($arr);
echo '
';

echo '
';<br>
echo 'pop出数组的元素是:<b>'.$arr_tmp .'</b>';<br>
echo '<br>';<br>
<br>
echo '调用函数array_pop()之后:';<br>
print_r($arr);<br>
?><br>
<br>
<strong>输出:</strong><br>
原数组:Array<br>
(<br>
    [0] => asp<br>
    [1] => php<br>
    [2] => jsp<br>
    [3] => .net<br>
    [4] => c++<br>
)<br>
pop出数组的元素是:c++<br>
调用函数array_pop()之后:Array<br>
(<br>
    [0] => asp<br>
    [1] => php<br>
    [2] => jsp<br>
    [3] => .net<br>
)
            <p style="width:100%;text-align:center;margin:10px 0">

<br>
<br>

</p><p style="width:100%;text-align:center;margin:10px 0">

            </p><p class="clear"></p>

           
Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.