$arr=array();
$arr['name']="John";
$arr['age']=30;
$arr['status']=1;
for ($i=0; $i < sizeof($arr); $i++) {
$key=array_key($arr,$i);
print("Key at Index ".$i." is ".$key." and value is ".$arr[$key]."\r\n");
}
?>
The above example will output:
Key at Index 0 is name and value is John
Key at Index 1 is age and value is 30
Key at Index 2 is status and value is 1
====See Also====
[[array()]] - Create an array, with optional values
[[array_keys()]] - Return keys for an array that has key/value pairs
[[sizeof()]] - Return the number of elements in an array
[[print_r()]] - Dump the contents of an array to the current output
[[uphp:variables|uPHP Variable Types and Limits]]