Page 1 of 1

Foreach loop

Posted: Wed May 19, 2010 2:55 pm
by samir_gambler
while iterating over arrays through foreach can we find the position of array currently being executed.....wether first element is currently being executed, 2nd or so on.......

Re: Foreach loop

Posted: Wed May 19, 2010 2:55 pm
by AbraCadaver

Code: Select all

foreach($array as $key => $value)
$key will be the key and $value will be the value.