Register|Login

Have a question? Click here to ask the community.

Tutorial 18 – Foreach Loop

| In: 18. Foreach Loop | 7,978 views

Video Tutorial


Video Source Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
//File Description: PHP Foreach Loop
 
/*
foreach ($array as $value) {
    execute this code
}
*/
 
// Example
$num = array(55, 900, 2, 32);
 
foreach ($num as $value) {
    echo "The current number is: $value <hr />";
}
 
?>

Comment Form

You must be logged in to post a comment.