- Forums
- Tutorial And Guides
- Learn PHP Repeating Code How To Repeat Information In Php With Loop Example Code
This Page Contains information about Learn PHP Repeating Code How To Repeat Information In Php With Loop Example Code By wallpaperama in category Tutorial And Guides with 0 Replies. [1413], Last Updated: Sat May 18, 2024
wallpaperama
Mon May 07, 2007
0 Comments
1047 Visits
looping allows you to repeat the execution of code. here is an example script i wrote to show you.
first, open you text editor, if you have windows, you can use notepad, then copy and paste this code into your notepad:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Learn How To Reapeat Code - Looping Tutoral by Wallpaperama</title>
</head>
<body>
<h1>Looping Tutoral by Wallpaperama
</h1><hr>
<p><strong>Today's Daily Affirmation </strong></p>
<p><strong>Repeat Three Times:</strong><br>
<?php
for ($count = 1; $count <+ 3; $count++)
{
echo "This is loop <b>$count</b><br>";
}
?>
</p>
</body>
</html>
now save the file as looping.php and upload to your php website. if you don't have php yet, we recommend our frieds at http://www.webune.com for PHP Web Hosting.
once you have uploaded the file looping.php to your website, you will see three sentences because that's how this script is configured, you can change the number 3 in this script to whatever number of times you want the script to repeat.