note 101389 added to function.current

From: Date: Tue, 14 Dec 2010 11:14:58 +0000
Subject: note 101389 added to function.current
Groups: php.notes 
Request: Send a blank email to php-notes+get-174899@lists.php.net to get a copy of this message
In reply to Daniel Alvarez Arribas: While it's not exactly equivalent to the function you wrote here, the task you want to solve (return the current value, then move the pointer forward) is the purpose of the each() function. If you're not interested in the keys of the array, you can use the list() operator with a missing first argument: <?php list( , $value ) = each( $array ); ?> ---- Server IP: 92.48.74.199 Probable Submitter: 81.179.240.16 ---- Manual Page -- http://www.php.net/manual/en/function.current.php Edit -- https://master.php.net/note/edit/101389 Del: integrated -- https://master.php.net/note/delete/101389/integrated Del: useless -- https://master.php.net/note/delete/101389/useless Del: bad code -- https://master.php.net/note/delete/101389/bad+code Del: spam -- https://master.php.net/note/delete/101389/spam Del: non-english -- https://master.php.net/note/delete/101389/non-english Del: in docs -- https://master.php.net/note/delete/101389/in+docs Del: other reasons-- https://master.php.net/note/delete/101389 Reject -- https://master.php.net/note/reject/101389 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#174899) next »