Using pre- and postincrement : Arithmetic Operators « Operator « PHP
- PHP
- Operator
- Arithmetic Operators
Using pre- and postincrement
<?php
$test=1;
echo "Preincrement: ".(++$test);
echo "<BR>";
echo "Value afterwords: ".$test;
echo "<BR>";
$test=1;
echo "Postincrement: ".($test++);
echo "<BR>";
echo "Value afterwords: ".$test;
?>
Related examples in the same category