Searching...
Monday 17 September 2012

Php Conditional Statements : If And Switch Statements

10:18 pm

Php Conditional Statements : If And Switch Statements

Php Conditional Statements : If And Switch Statements :

There are two types of php conditional statements they are
1.       If statement
2.       Switch statement
Different if statements :
1.       Simple  if statemenet.
2.       If     else statement .
3.       If     else  if else   statement [ladder if].
4.       Nested if
2.Switch Statement :
Ex: switch statement      
        <?php
             Echo “<h1>”.
              $c = “A”
              Switch($c)
                    {
                         Case  “A”                                                     without break point output is      ABCD
                           Echo “A”;                                                       with break point output is    A
                            Break;
                          Case   “B”
                             Echo  “B”;
                                Break;
                            Case   “C”
                                 Echo  “C”;
                                  Break;
                                Default :  echo  “D”;
                          }

Php Conditional Statements : If And Switch Statements


1 comments: