Changes

PHP Operators

173 bytes added, 13:02, 31 May 2007
PHP Comparison Operators
<th>Operator<th>Type<th>Description<th>Examples</th>
<tr>
<td>==<td>Equal to<td>Checks Returns ''true'' if first operand equals second<td>$myVar = 10; <br>if ($myVar == 10)<br>echo 'myVar equals 10';</td><td>!=<td>Not equal to<td>Returns ''true'' if first operand is not equal to second<td>$myVar = 10; <br>if ($myVar == 10)<br>echo 'myVar equals 10';</td>
<tr>
<td>===<td>Equal to<td>Checks Returns ''true'' if first operand equals second in both value and type<td>$myVar = 10;<br>$myString="10"; <br>if ($myVar === $myString)<br>echo 'myVar and myString are same type and value';</td>
</table>