PHP Operator


PHP OPERATOR

The operator is useful to perform an operation on a value. Operators in PHP is very common so it is easy to understand. Here we will discuss the service that is often used.

Arithmetic Operators
$ x + $ y; / / for the summation
$ x - $ y; / / for the reduction
$ x * $ y; / / for multiplication
$ x / $ y; / / for division
$ x% $ y; / / for the rest of the results for (modulus)

Assignment Operators
$ x = $ y;
$ x + = 1; / / same as $ x = $ x + 1;
$ x -= 1; / / same as $ x = $ x - 1;
$ x *= 1; / / same as $ x = $ x * 1;
$ x / = 1; / / same as $ x = $ x / 1;

Comparison Operators
$ x == $ y; / / equal to, if $x is equal to $y would yield TRUE, FALSE if not the same result
$ x === $ y; / / identical
$ x! = $ y; / / not the same
$ x <$ y; / / smaller than
$ x> $ y; / / greater than
$ x <= $ y; / / less than or equal to
$ x> = $ y; / / greater than or equal to

Increment and Decrement Operators
$ x++; / / operations carried out, the new value of $ x plus one
$ x-; / / operations carried out, the new value of $ x minus one
$ x++; / / equal to the value of $ x plus one then start operation
$ x-; / / equal to the value of $ x minus one then start operation

0 comments:

Post a Comment