Hashes - AKA - Associative arrays
Creating Hashes
$hash = array("AL" => "Alabama", "AK" => "Alaska", ...);
Iteration:
foreach($hash AS $index => $value) {
echo "Index:$index - Value:$value<br />";
}
Other hash functions:
- asort() - sorts the values of a hash
- arsort() - reverse the values of a hash
- ksort() - sorts the indexes of a hash
INDEX
PREVIOUS
Master Index