for loop in php dictionary code example Example: loop over keys and values php foreach ($arr as $key => $value) { echo $key; }