<?php
// A simple PHP for loop example
// Initialize the loop
for ($i = 1; $i <= 10; $i++) {
// Print the current value of $i
echo "Number: $i<br>";
}
?>
6 months ago
Looping is the concept of repeating a block of code repeatedly until a certain condition is met, it also repeats a block of code for each items in an array.
looping is a process of repeating a section of code. it allows us to execute a block of code repeatedly.
The for loop is my favorite.
To declare a For loop, you will declare a variable, followed by your for loop function.
3 Comment
dev sahar 5 months ago
<?php // A simple PHP for loop example // Initialize the loop for ($i = 1; $i <= 10; $i++) { // Print the current value of $i echo "Number: $i<br>"; } ?>
6 months ago
Looping is the concept of repeating a block of code repeatedly until a certain condition is met, it also repeats a block of code for each items in an array.
Ogunbona Olayinka 6 months ago
looping is a process of repeating a section of code. it allows us to execute a block of code repeatedly. The for loop is my favorite. To declare a For loop, you will declare a variable, followed by your for loop function.