/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
BUT You can work around this by replacing the ‘foreach’ with a ‘while’ loop, but before you do so, you must know that the following loops are functionally identical: foreach ($days as $day) { echo $day; } echo $day; } The same is true for these two, they are functionally identical: foreach ($days as $i => $day) { echo $i .': ' .$day; } echo $i .': ' .$day; } /* Skip white spaces */ if ($token == ' ') { } }
URL: http://codingrecipes.com/php-advancing-array-pointer-in-a-foreach-loop