foreach Loop
The foreach loop works only on arrays, and is used to loop through each key/value pair in an array.Syntax foreach ($array as $value) { code to be executed; }Example
<?php $colors = array("red", "green", "blue", "yellow"); foreach ($colors as $value) { echo "$value <br>"; } ?>e
No comments:
Post a Comment