How to use For Loop in PHP

Friday, July 10, 2009 · Posted in

Here is a sample of using a for loop in a PHP language.

Code:

<?php

for($var_x=1; $var_x<=5; $var_x++)
{
echo "Number: ".$var_x."<br/>";
}

?>
Sample output:
If there are some comments or questions about this article just CLICK THIS LINK to be redirected to the forum page.

Powered by Blogger.