Changes

PHP Operators

336 bytes added, 20:43, 30 May 2007
PHP Arithmetic Operators
<td>%<td>Modulus<td>Returns the reminader from dividing the first operand by the second<td> $total = 20%10;
</table>
 
Arithmetic operators work with two operands, one to left and the other to the right of the operator. For example:
 
<pre>
$var = 1 + 2; // Sets variable $var to the sum of 1 + 2
 
$var = 3 % 7; // Sets variable $var to the modulus of 3 and 7
 
$var1 = 10;
 
$var2 = $var1 / 2; // Sets variable $var2 to the value of 10 divided by 2
</pre>
== PHP Increment and Decrement Operators ==