PHP - While

Card Puncher Data Processing

Snippet

each

each

while(list($key, $value) = each($array)){
  ...
}

Array Shift

Loop over an array with a array_shift

while ($page = array_shift($pages)) {
   $page ...
}

Break a while in a switch

while (++$i) {
    switch ($i) {
        case 5:
            break 1;  /* Exit only the switch. */
        case 10:
            break 2;  /* Exit the switch and the while. */
        default:
            break;
    }
}





Discover More
Card Puncher Data Processing
Php - Array (Map)

In Php, an array is an(ordered|sorted) map (keys/value) Array can contain others arrays. The key can either be an integer or a string (in the same array - PHP does not distinguish between indexed...



Share this page:
Follow us:
Task Runner