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