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

Associative Array

  • hash
  • dictionary

Associative or Named Arrays are maps where the keys can be either strings or numbers.

<h1>Named Arrays</h1>
<?php
$length = array("php" => 3, "mysql" => 5, "linux" => 5);
print $length["php"];

print "x";
print $length["xyz"];
print "x";
?>