How to use array pop in PHP
In this article, I will explain how the array_pop() function can be used in PHP.
array_pop() function in PHP
-
The array_pop() function is used to deletes the last element of an array.
-
In array_pop() function, if array is empty, Null will be returned.
-
The array_pop() function return the last value of array.
Syntax
Parameter
Example
The following example show to how the array_pop() function can be used in PHP.
<html>
<html>
<body>
<h3 style="color: yellowgreen;">array_pop() function example in PHP</h3>
<?php
$a1=array("Student".'<br/>',"Teacher".'<br/>',"Engg.".'<br/>');
print_r($a1);
echo("<br/>pop value<br/>");
print_r(array_pop($a1));
?>
</body>
</html>
|
Output

You may also want to read these related articles here
Ask Your Question
Got a programming related question? You may want to post your question here