Html4newbies
Put your hands into html and php
Home
Privacy
About
Contact

Hosting Links
Hosting
Free Php Snippets
Php Snippets 1
Php Snippets 2
Php Operators


Using Operators
Operators perform operations on variables and values

Assignment Operators
Result:
$my_var = 2;
$another_var = $my_var;


Both vars now contain the value of 4

Arithmetic Operators

Result:
Perform addition: 1 + 9 = 10
Perform subtraction: 5 - 1 = 4
Perform multiplication: 2 * 5 = 10
Perform division: 15 / 3 = 5
Perform modulus: 5 % 2 = 1


Comparison Operators
Comparisons are used to check the relationship between variables and values


OperatorEnglish Example Result
== Equal To $x == $y false
!= Not Equal To $x != $y true
< Less Than $x < $y true
> Greater Than $x > $y false
<= Less Than or Equal To $x <= $y true
>= Greater Than or Equal To $x >= $y false


Copyright © 2002-2017 Html4newbies - Html4newbies.com NetWork