2014. szeptember 11., csütörtök

PHP while ciklus

Elöltesztelő ciklus, addig fut, amíg a feltétel igaz.

pl:
<!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Listing 5.6 A while Statement</title>
</head>
<body>
<div>
<?php
$counter = 1;
while ( $counter <= 12 ) {
    print "$counter times 2 is ".($counter*2)."<br />";
    $counter++;
}
?>
</div>
</body>
</html>


Eredmény:
We are sorry that we have not met your expectations

Nincsenek megjegyzések:

Megjegyzés küldése