Home Yellow Pages Movies Classifieds Jokes Jobs Free Hosting Videos




Increment Operator ( ++ )

Incremental Operator (++) is used to increase value of a variable.

<?php
$num=5;
$num++;
echo $num;
?>

Displays the output as 6.

Decrement operator ( -- )

Decremental Operator (--) is used to decrease value of a variable.

<?php
$num=5;
$num--;
echo $num;
?>

Displays the output as 4.

Preincrement operator and Predecrement operator
Example
<?php
$num="5";
echo ++$num;
echo "<BR>";
echo $num;
?>

Displays the output as 6. One more 6 will be displayed in the next line due to BR command.

Similarly, for Pre decrement operator echo --$num; can be used.

Back to Home
BizHat.com   Bookmark   Astrology   Chat Room   Classifieds   Computer   Downloads   Directory   Dating   Domain Tools   Education   eCards   Finance   Forums   Freelance Work   Free Hosting   Free Mail   Gallery   Games   Guest Book   Greeting Cards   Ham Radio   Health   Home Business   Hosting Tutorials   Hosting Directory   India   Jobs   Jokes   Kerala   Matrimonial   Music   Movies   News   News Letter   Recipes   Real Estate   Search   SMS   Tourist Guide   Top 100 Sites   Vote Us   Yellow Pages   Arthunkal Church   Site Map  

Google