4. PHP – Operators.


g1ng3r410

==>Arithmetic operators.

We can perform various arithmetic operations like addition (+), subtraction (-), multiplication (*), division (/) and modulus (%).
$variable (or a constant value) operator $variable (or a constant value).
Here is the code that demonstrates various arithmetic operations.

==>Assignment Operator.

We use ‘=’ to assign.
$variable = <value>
The example code :

==>String Operators.

Concatenation : We use the dot (.) operator to achieve concatenation.
$variable (or a string).$variable (or a string)

==>Increment/Decrement Operators.

1. Pre-increment (++$variable).
2. Post-increment ($variable++).
3. Pre-decrement (–$variable).
4. Post-decrement ($variable–).

==>Comparison Operators.

1. Equal (==) :  Data types are not considered, just the values are considered.
2. Identical (===) : Data types are considered.
3. Not equal (!= ).
4. Not identical (!==).
5. Less than (<).
6. Less than or equal (<=).
7. Greater than (>).
8. Greater than or equal (>=).

==>Logical Operators.

1. AND ($variable and $variable / $variable &&…

View original post 42 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s