PHP Control Structures

 

List of operators in PHP and it’s types:

Operator are mainly divided by three groups.

1.Uniary Operators that takes one values

2.Binary Operators that takes two values

3.ternary operators that takes three values

Operator are mainly divided by three groups that are totally seventeen types.

1.Arithmetic Operator

+ = Addition

– = Subtraction

* = Multiplication

/ = Division

% = Modulo

** = Exponentiation

2.Assignment Operator

     = “equal to

3.Array Operator

    + = Union

    == = Equality

    === = Identity

    != = Inequality

    <> = Inequality

    !== =    Non-identity

4.Bitwise Operator

& = and 

^ = xor

| = not

<< = shift left

>> = shift right

5.Comparison Operator

==  = equal

=== = identical

!=  = not equal

!== = not identical

<>  = not equal

< = less than

<= less than or equal

> = greater than

>= = greater than or equal

<=> = spaceship operator

6.Execution Operator

 “ = backticks  

7.Error Control Operator

    @ = at sign

8.Incrementing/Decrementing Operator

    ++$a = PreIncrement

    $a++ = PostIncrement

    –$a = PreDecrement

    $a– = Postdecrement

9.Logical Operator

    && = And

    || = Or

    ! = Not

    and = And

    xor = Xor

    or = Or

10.string Operator

    . =  concatenation operator

    .= concatenating assignment operator

11.Type Operator

    instanceof = instanceof

12.Ternary or Conditional operator

   ?: = Ternary operator

13.Null Coalescing Operator

    ??” = null coalescing 

14.Clone new Operator

    clone new = clone new

15.yield from Operator

    yield from = yield from

16.yield Operator

    yield = yield

17.print Operator

    print = print

1. If a condition is true then do this

2. If a condition is true then do this else do this

3. If a condition is true then do this else do that{ }  do this or { }  do that depending on the choice of whether condition is true or false.

4. while(condition)

Output:

The array is NOT empty!bool(true) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, Good EveningSorry! I’m busy!

3 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Enable Notifications OK No thanks