Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Array in key/value pairs using each

  • each
  • list
<?php

$a = array('two' => 2, 'one' => 1, 'three' => 3);
while (list($key, $value) = each($a)) {
    print "$key   $value\n";
}
?>