To create your own while loop using PHP and HTML via Notepad++. Your while loop does not have to completely function, meaning it doesn't have to process a lot, just create the loop along with some other mini things in HTML like a few outputs when run
CODE
<?php
$i=1; //Creating a variable for counting the numbers
while ($i<=10):?>
<h1> This is inside while loop and prining by while loop. The number is= <?php echo $i; ?> </h1>
<?php $i=$i+1; //On the above staatement declaring the html
tag and printing the number.
//Incrementing the value to print next number
endwhile; //Ending the while loop
?>
ALL THE EXPLAINATION IS COMMENTED IN THE CODE ITSELF. THIS CODE WILL PRINT YOU 1-10 NUMBERS USING HTML TAG INSIDE WHILE LOOP.
Note: If you have any queries than let me know in the comments. If you find it helpful then a Like would be appreciated
Get Answers For Free
Most questions answered within 1 hours.