php iterate associative array keys code example Example: loop through values of hash php foreach ($array as $key => $val) { print "$key = $val\n"; }