To iterate over a dictionary (associative array) in PHP, you can use the foreach
loop.
main.php143 chars6 lines
This will output:
main.php39 chars4 lines
In the foreach
loop, the $key
variable will contain the key of the current element, and the $value
variable will contain the value. You can then use these variables to perform any required operations in the loop.
gistlibby LogSnag