note 129636 added to function.array-pop
| From: | Anonymous | Date: | Thu, 04 Jul 2024 04:43:42 +0000 |
| Subject: | note 129636 added to function.array-pop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221408@lists.php.net to get a copy of this message | ||
array_pop doesn't care about your array keys, numeric or not, only the insertion order!
<?php
$array = array(
3 => '33',
'00',
'b' => 'bb',
'44',
'a' => 'aa',
1 => '11',
'55',
);
while( $array ) echo array_pop( $array ), ' ';
// 55 11 aa 44 bb 00 33
?>
Live test (PHP 4.3 to 8.3): https://3v4l.org/feWtM
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 84.236.79.165)
----
Manual Page -- https://php.net/manual/en/function.array-pop.php
Edit -- https://main.php.net/note/edit/129636
Del: integrated -- https://main.php.net/note/delete/129636/integrated
Del: useless -- https://main.php.net/note/delete/129636/useless
Del: bad code -- https://main.php.net/note/delete/129636/bad+code
Del: spam -- https://main.php.net/note/delete/129636/spam
Del: non-english -- https://main.php.net/note/delete/129636/non-english
Del: in docs -- https://main.php.net/note/delete/129636/in+docs
Del: other reasons-- https://main.php.net/note/delete/129636
Reject -- https://main.php.net/note/reject/129636
Search -- https://main.php.net/manage/user-notes.php