Programming Loops
{
echo " counter = " . $counter . "<BR>";
$counter ;
}
?>
This type is loop is almost identical to the while loop,except that the condition comes at the end.
do
statement
while (condition)
The difference is that your statement gets executed at least once. In a normal while loop,the condition could be met before your statement gets executed.
Break statement is used to stop the loop while loop is running to complete its round.
<?
$counter = 1;
while ($counter < 11)
{
echo " counter = " . $counter . "<BR>";
if($counter==7) break;
$counter ;
}
?> The loop goes round and round. Loops are used to redo the same action again and again until the limit you set. for (start value; end value; update expression) {} <? { // $start equivalent to the $start = $start 1; // $start-- equivalent to the $start = $start - 1; ?> The structure of a while loop is more simple than a for loop,because you’re only evaluating the one condition. The loop goes round and round while the condition is true. When the condition is false,the programme breaks out of the while loop. while (condition) { <? $counter = 1;
$counter = 0;
for($start=1; $start < 11; $start )
$counter = $counter 1;
echo $counter . "<BR>";
}
statement
}
while ($counter < 11)
Php Discussion
- - PHP 4 or 5 as a Deploymen
- - How do I decode a html/ph
- - PHP help
- - What is wamp?
- - How to execute a php file
Php Source Code
- - Wraps A String To A Given
number Of Characters Using A
string Break Character - - Uppercase The First Character
of Each Word In A String - - Make A String's First Character
uppercase - - Strip Whitespace (or Other
characters) From The Beginning
and End Of A String - - Return Part Of A String





