Home > Backend Development > PHP Tutorial > Photoshop learning experience PHP learning loop structure implementation code

Photoshop learning experience PHP learning loop structure implementation code

WBOY
Release: 2016-07-29 08:45:27
Original
1042 people have browsed it

Copy the code The code is as follows:


/* Loop structure
* 1. while loop
* while (expression)
* {
* Loop body; // Repeatedly execute until the expression The formula is false
* }
* 2. do-while loop
* 3. for loop
*
* According to different loop conditions, there are two types of loops
*
* One: counting loop (generally use for)
* Another type: conditional loop (generally use while do-while)
*
*
*
*/
//Use of while
/*$num=0;
while($num<100)
{
echo "Output result{$num}";
$num++;
}*/
//while output table
echo '

';
echo '';
$i=0;
while($i<1000)
{
//Change a line every 10 times
if($i%10==0)
{
if($i%20==0)
{
$bg="#ffffff";
}
else
{
$bg="#cccccc";
}
echo '';//Output interlaced color change
}
echo '';
$ i++;
if($i%10==0)
{
echo '';
}
}
echo '

Use while to output the table

'.$i.'
';
?>

The above introduces the loop structure implementation code of photoshop learning experience and PHP learning, including the content of photoshop learning experience. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template