Wednesday, 24 September 2014

array_pop in PHP

array_pop() function returns the last element from array, resetting pointer upon completion.

The PHP array_pop() function is utilized to delete the last element from an input array.

Syntax:

array_pop(array)
array : Required. Specifies an array

Example:

<?php
$daysarr1 = array( "Sunday","Monday","Tuesday" );
print_r( array_pop($daysarr1) );
?>

O/P:


Tuesday

0 comments:

Post a Comment