Answers for "for loop increment and decrement php"

PHP
1

for loop php increment by 2

for ($i=1; $i <=10; $i+=2) 
{ 
    echo $i.'<br>';
}
Posted by: Guest on February-27-2020
3

php increment variable

$var = 0;
// use value (0) THEN increment by one
$var++;
// increment by one THEN use value (1)
++$var;

// aside: increment by custom amount (1 emulates the above)
$var += 1;
$var += $amount;
Posted by: Guest on February-17-2021

Code answers related to "for loop increment and decrement php"

Browse Popular Code Answers by Language