Changes

Jump to: navigation, search

PHP Operators

296 bytes added, 20:13, 30 May 2007
PHP Increment and Decrement Operators
<table border="1" cellspacing="0">
<tr>
<th>Operator<th>Type<th>Description<th>Usage<th>Equivalent</th>
<tr>
<td>++$var<td>Preincrement<td>Increments the variable value before it is used in rest of expression<td>$var = 10;<br>$var2 = $var + 1;</td>
<tr><td>--$var<td>Predecrement<td>Decrements the variable value before it is used in rest of expression<td>$var = 10;<br>$var2 = $var - 1;</td><tr><td>$var++<td>Postincrement<td>Increments the variable value after it is used in rest of expression<td>$var = 10;<br>$var2 = $var;<br>$var = $var + 1;</td>
</table>

Navigation menu