SlideShare a Scribd company logo
1 of 2
1. if else
switchcase
<?php
$user = "john";
switch ($user) {
case 'genetic':
echo "genetic";
break;
case 'john':
echo "john";
break;
case 'smith':
echo "smith";
break;
case 'tony':
echo "tony";
break;
case 'admn':
echo "admn";
break;
default:
echo "The name doesn't match in this case";
break;
}
?>
2. 1 4
10 1 , 4 10
switch…case
<?php
$x = 2;
switch ($x)
{
case 1:
echo " 1";
break;
case 4:
echo " 4";
break;
case 10:
echo " 10";
break;
default:
echo " 1 , 4 10";
}?>

More Related Content

Viewers also liked (6)

islamic letter of credit
islamic letter of creditislamic letter of credit
islamic letter of credit
 
TPL Dataflow – зачем и для кого?
TPL Dataflow – зачем и для кого?TPL Dataflow – зачем и для кого?
TPL Dataflow – зачем и для кого?
 
Pp lag och rätt 2014gul
Pp lag och rätt 2014gulPp lag och rätt 2014gul
Pp lag och rätt 2014gul
 
Great indian scientists
Great indian scientists  Great indian scientists
Great indian scientists
 
Christmas celebration presentation
Christmas celebration  presentationChristmas celebration  presentation
Christmas celebration presentation
 
Nature
NatureNature
Nature
 

More from KwanJai Cherubstar (20)

Introprogramphp
IntroprogramphpIntroprogramphp
Introprogramphp
 
Programstructure
ProgramstructureProgramstructure
Programstructure
 
ความรู้เบื้องต้นเกี่ยวกับภาษาPhp
ความรู้เบื้องต้นเกี่ยวกับภาษาPhpความรู้เบื้องต้นเกี่ยวกับภาษาPhp
ความรู้เบื้องต้นเกี่ยวกับภาษาPhp
 
Unit3.1variables
Unit3.1variablesUnit3.1variables
Unit3.1variables
 
Unit4maintain edit
Unit4maintain editUnit4maintain edit
Unit4maintain edit
 
Unit4maintain
Unit4maintainUnit4maintain
Unit4maintain
 
Unit3coding
Unit3codingUnit3coding
Unit3coding
 
Unit2flowchart
Unit2flowchartUnit2flowchart
Unit2flowchart
 
Unit1 ph pprogram
Unit1 ph pprogramUnit1 ph pprogram
Unit1 ph pprogram
 
Answer unit4.3.2
Answer unit4.3.2Answer unit4.3.2
Answer unit4.3.2
 
Answer unit4.3.1
Answer unit4.3.1Answer unit4.3.1
Answer unit4.3.1
 
Answer unit4.2.5
Answer unit4.2.5Answer unit4.2.5
Answer unit4.2.5
 
Answer unit4.2.4
Answer unit4.2.4Answer unit4.2.4
Answer unit4.2.4
 
Answer unit4.2.3
Answer unit4.2.3Answer unit4.2.3
Answer unit4.2.3
 
Answer unit4.2.2
Answer unit4.2.2Answer unit4.2.2
Answer unit4.2.2
 
Answer unit4.2.1
Answer unit4.2.1Answer unit4.2.1
Answer unit4.2.1
 
Answer unit4.1.2
Answer unit4.1.2Answer unit4.1.2
Answer unit4.1.2
 
Answer unit4.1.1
Answer unit4.1.1Answer unit4.1.1
Answer unit4.1.1
 
Answer unit3.2
Answer unit3.2Answer unit3.2
Answer unit3.2
 
Answer unit3.1
Answer unit3.1Answer unit3.1
Answer unit3.1
 

Answer unit4.4.1

  • 1. 1. if else switchcase <?php $user = "john"; switch ($user) { case 'genetic': echo "genetic"; break; case 'john': echo "john"; break; case 'smith': echo "smith"; break; case 'tony': echo "tony"; break; case 'admn': echo "admn"; break; default: echo "The name doesn't match in this case"; break; } ?>
  • 2. 2. 1 4 10 1 , 4 10 switch…case <?php $x = 2; switch ($x) { case 1: echo " 1"; break; case 4: echo " 4"; break; case 10: echo " 10"; break; default: echo " 1 , 4 10"; }?>