";
echo $users[1]."
";
echo $users[2]."
";
echo $users[3]."
";
?>
";
for ($loop=0; $loop
";
for ($loop=0; $loop
value .... pair
$character = array (
"name" => "bob",
"occupation" => "superhero",
"age" => 30,
"special power" => "x-ray vision"
);
print $character["name"]."
";
print $character["occupation"]."
";
print $character["age"]."
";
print $character["special power"]."
";
//adding stuff to it later
$character["hobby"] = "cutting grass";
print $character["hobby"]."
";
print "===============
";
foreach ($character as $a=>$b)
{
print "$a = $b
";
}
unset($character["hobby"]); //remove stuff
print "===============
";
foreach ($character as $a=>$b)
{
print "$a = $b
";
}
?>
100,
"e" => 50,
"a" => 30,
"b" => 20
);
foreach ($hashtable as $a=>$b)
{
print "$a = $b
";
}
ksort($hashtable); //keysort
print "After ksort:
";
foreach ($hashtable as $a=>$b)
{
print "$a = $b
";
}
asort($hashtable); //valuesort
print "After asort:
";
foreach ($hashtable as $a=>$b)
{
print "$a = $b
";
}
?>