What is increment and decrement operators in php?
PHP supports C-style pre- and post-increment and decrement operators. Show Increment/decrement Operators
Here's a simple example script:
" PHP follows Perl's convention when dealing with arithmetic operations on character variables and not C's. For example, in PHP and Perl Example #1 Arithmetic Operations on Character Variables
The above example will output: == Characters == X Y Z AA AB AC == Digits == A9 B0 B1 B2 B3 B4 A09 A10 A11 A12 A13 A14 Incrementing or decrementing booleans has no effect. hartmut at php dot net ¶ 10 years ago
ayyappan dot ashok at gmail dot com ¶ 6 years ago
aluciffer at hotmail dot com ¶ 7 years ago
$n=10; $n>0; $n--) { cleong at letstalk dot com ¶ 20 years ago
dsbeam at gmail dot com ¶ 13 years ago
( 'MAX_EXEC_TIME', 120 ); ayyappan dot ashok at gmail dot com ¶ 6 years ago
leo zandvliet ¶ 3 years ago
testFunctionNesting($max, $increment, $preIncrement, $postIncrement) Brad Proctor ¶ 11 years ago
sneskid at hotmail dot com ¶ 13 years ago
fred at surleau dot com ¶ 21 years ago
What is postPost-increment. Returns $x, then increments $x by 1. --$x. Pre-decrement. Decrements $x by 1, then returns $x.
What is the difference between ++$ J and J ++ in PHP?There is no difference between ++$j and $j++ unless the value of $j is being tested, assigned to another variable, or passed as a parameter to a function.
How do you increment in PHP?PHP has a built-in way of incrementing either a number or a string simply by placing ++ at the end of the variable. // Number $i = 1; $i++; // echo 2 echo $i; But you can also do this for letters, PHP will increment the variable to the next letter in the alphabet.
Which of the following PHP operator is post decrement operator?Note: The increment/decrement operators only affect numbers and strings. Arrays, objects, booleans and resources are not affected.
...
Increment/decrement Operators.. |