note 119897 added to function.current

From: Date: Fri, 16 Sep 2016 14:50:38 +0000
Subject: note 119897 added to function.current
Groups: php.notes 
Request: Send a blank email to php-notes+get-206604@lists.php.net to get a copy of this message
As Sergey stated a long time ago in this notes, when adding to the array using the brackets syntax, current won't return the last added value. Instead of moving the pointer with end(), you simply can get the last value with <?php $my_array[count($my_array) - 1] ?> (only applies to a non-associative array). ---- Server IP: 72.52.91.14 Probable Submitter: 132.203.52.176 ---- Manual Page -- http://php.net/manual/en/function.current.php Edit -- https://master.php.net/note/edit/119897 Del: integrated -- https://master.php.net/note/delete/119897/integrated Del: useless -- https://master.php.net/note/delete/119897/useless Del: bad code -- https://master.php.net/note/delete/119897/bad+code Del: spam -- https://master.php.net/note/delete/119897/spam Del: non-english -- https://master.php.net/note/delete/119897/non-english Del: in docs -- https://master.php.net/note/delete/119897/in+docs Del: other reasons-- https://master.php.net/note/delete/119897 Reject -- https://master.php.net/note/reject/119897 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#206604) next »