PHP Decrement Operator
Some of the most frequently used code in PHP or any programming language is the code that will increment or decrement the value of a variable. This code or expression is used in programs as simple as a page counter or as complicated as credit card processing.
decrement() decrements value of the item by value. Consider the following example.
$num = 8;
echo "<br /> " . $num--;
echo "<br /> " . --$num;
Decrements $a by one, then returns $a.
Returns $a, then decrements $a by one.
- PHP Increment Operator Some of the most frequently used code in PHP or any programming language is the code […]
- Simple PHP Script – Lets Start PHP – Echo Hello PHP If you want to learn PHP you have come to the right place. I will not only teach you how […]
- PHP While Loop The while keyword takes a condition in parentheses, and the code block that follows is […]
- PHP Do While Loop A "do while" loop is a slightly modified version of the while loop. A do-while loop […]
- PHP Switch Statement Examples With the use of the switch statement you can check for many conditions at once, and the […]
- PHP For Loop For loop consists of three phases. i.e.
Increment or […]
- Action At Link Using PHP Use this example to show some hidden message at page using PHP. You can use two pages […]
- PHP Functions A function is just a name we give to a block of code that can be executed whenever we […]
- PHP ForEach Loop PHP provides an easy way to use every element of an array with the For each statement. […]
- PHP Logical Operators Logical operators are true or false.
Value is not one
4 && 4 […]