> while statement in php ~ Online tutorial

while statement in php

The while Statement
The while statement will execute a block of code if and as long as a condition is true.
Syntax
while (condition)
code to be executed;
Example
The following example demonstrates a loop that will continue to run as long as the variable i is
less than, or equal to 5. i will increase by 1 each time the loop runs:

<html>
<body>
<?php
$i=1;
while($i<=5)
{
echo "The number is " . $i . "
$i++;
}
?>

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: