note 127902 added to function.each

From: Date: Tue, 08 Nov 2022 13:46:27 +0000
Subject: note 127902 added to function.each
Groups: php.notes 
Request: Send a blank email to php-notes+get-219857@lists.php.net to get a copy of this message
Following the obsolescence of the each() function, here is a way to correct your source codes: If you use each() in a while loop like this: while (list($Key,$Value)=@each($Array)){ .... } you have to replace with foreach ($Array as $Key => $Value){ .... } In the same minds. while (list(,$Value)=@each($Array)){ .... } will become foreach ($Array as $Value){ .... } ---- Server IP: 45.112.84.4 Probable Submitter: 45.91.157.131 (proxied: 208.127.60.43) ---- Manual Page -- https://php.net/manual/en/function.each.php Edit -- https://main.php.net/note/edit/127902 Del: integrated -- https://main.php.net/note/delete/127902/integrated Del: useless -- https://main.php.net/note/delete/127902/useless Del: bad code -- https://main.php.net/note/delete/127902/bad+code Del: spam -- https://main.php.net/note/delete/127902/spam Del: non-english -- https://main.php.net/note/delete/127902/non-english Del: in docs -- https://main.php.net/note/delete/127902/in+docs Del: other reasons-- https://main.php.net/note/delete/127902 Reject -- https://main.php.net/note/reject/127902 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#219857) next »