For Loop in PHP

Advertisements

Operators in PHP While Loop in PHP

For Loop in PHP

The for loop is used when you know in advance how many times the script should run. In php for loops execute a block of code specified number of times.

Syntax

for (initilation; condition; increment/decrement)
{
    code to be executed;
}

Example of for Loop in PHP

<?php

for ($i = 0; $i <= 10; $i++) 
{
    echo "$i <br>";
}

?>

Output

0 1 2 3 4 5 6 7 8 9 10

Operators in PHP While Loop in PHP

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements