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

Advertisements

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

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

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

Download Projects