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

  • foreach
  • as
<?php
$a = array('two' => 2, 'one' => 1, 'three' => 3);
foreach ($a as $key => $value) {
   print "$key   $value\n";
}
?>