SlideShare a Scribd company logo
1 of 41
TRIVUz Academy

                             PF02
                 Class Id:




Programming Fundamentals
                              MS Alam TRIVUz
                                 Founder, TRIVUz Network
TRIVUz Academy
TRIVUz Academy




Recap PF01



             TRIVUz Academy
We learn before
                           We Define Computer & Program

                           Define Computer Programming

                                   Programming Process

                                 Programming Language

                                         Inputs & Outputs

                                Define Logical Processing

                                               Variables

                                              Data Types
Programming Fundamentals


 TRIVUz Academy

                                    www.trivuzacademy.com
We will learn today
                                  Conditional Statement

                                        If… then … else

                                       Switch statement

                                             Operators




Programming Fundamentals


 TRIVUz Academy
www.trivuzacademy.com
Conditional Statement
• Conditional statements are the set of
  command used to perform different
  actions base on different conditions
• In PHP we have the following conditional
  statements:
   • if
   • if else
   • else if
   • switch


                               TRIVUz Academy
If statement
        execute some code only if statement is true




TRIVUz Academy
If…




TRIVUz Academy
If…
  if




TRIVUz Academy
If…
  if (conditional)




TRIVUz Academy
If…
  if (conditional) {




TRIVUz Academy
If…
  if (conditional) {
   // statement to be executed




TRIVUz Academy
If…
  if (conditional) {
   // statement to be executed
  }




TRIVUz Academy
If…
  Example:

  if ($math < 33) {
    $result = “Failed!”;
  }




TRIVUz Academy
If…else statement
          execute some code if statement is true
         and some other code if statement is false




TRIVUz Academy
If…else…
  if (conditional) {
   // statement if true
  }




TRIVUz Academy
If…else…
  if (conditional) {
   // statement if true
  } else




TRIVUz Academy
If…else…
  if (conditional) {
   // statement if true
  } else {
   // statement if false




TRIVUz Academy
If…else…
  if (conditional) {
   // statement if true
  } else {
   // statement if false
  }




TRIVUz Academy
If…else…
  Example:

  if ($math < 33) {
    $result = “Failed!”;
  } else {
    $result = “Passed!”;
  }




TRIVUz Academy
If…else if…else statement
          execute some code if statement is true
         And some other code if statement is false




TRIVUz Academy
If…else if…else
  if (conditional) {
   // statement if true
  } else if (conditional){
   // statement if false and else if true
  } else {
   // statement if all false
  }


TRIVUz Academy
If…else if…else
      if (conditional) {
         // statement if true
       } else if (conditional){
         // whichever matches first
       } else if (conditional){
         // whichever matches first
       } else if (conditional){
         // whichever matches first
       } else if (conditional){
         // whichever matches first
       } else {
         // statement if all false
      }

TRIVUz Academy
If…else if…else
  Example:

    if ($avg > 100) {
        $grade = "Invalid";
    }
    else if ($avg > 90 and $avg < 100 ) {
        $grade = "A+";
    }
    else if($avg > 80 and $avg < 90) {
        $grade = "A";
    }
    else {
        $grade = "F";
    }

TRIVUz Academy
switch statement
       Select one of many block of code to execute




TRIVUz Academy
switch
  switch




TRIVUz Academy
switch
  switch (value)




TRIVUz Academy
switch
  switch (value) {




TRIVUz Academy
switch
  switch (value) {
   case 1:
    // some code to execute




TRIVUz Academy
switch
  switch (value) {
   case 1:
    // some code to execute
    break;




TRIVUz Academy
switch
  switch (value) {
   case 1:
    // some code to execute
    break;
   case 2:
    // some code to execute
    break;



TRIVUz Academy
switch
  switch (value) {
   case 1:
    // some code to execute
    break;
   case 2:
    // some code to execute
    break;
   default:
    // nothing matches, do it

TRIVUz Academy
switch
  switch (value) {
   case 1:
    // some code to execute
    break;
   case 2:
    // some code to execute
    break;
   default:  similar to else in if..else
    // nothing matches, do it

TRIVUz Academy
switch
  switch (value) {
    case 1:
     // some code to execute
     break;
    case 2:
     // some code to execute
     break;
    default:
     // nothing matches, do it
  }
TRIVUz Academy
switch
switch (n)
{
case label1:
  code to be executed if n=label1;
  break;
case label2:
  code to be executed if n=label2;
  break;
default:
  code to be executed if n is different from both label1
and label2;
}

                                          TRIVUz Academy
switch
<html>
<body>
<?php
    switch ($x)
    {
      case 1:
        echo "Number 1";
      break;
      case 2:
        echo "Number 2";
      break;
      case 3:
        echo "Number 3";
      break;
      default:
        echo "No number between 1 and 3";
   }
?>
</body>
                                            TRIVUz Academy
</html>
PHP Operators
         Operators are used to operate on values




TRIVUz Academy
Operators
Arithmetic Operators




            TRIVUz Academy
Operators
Assignment Operators




             TRIVUz Academy
Operators
Comparison Operators




             TRIVUz Academy
Operators
Logical Operators




         TRIVUz Academy
Thank You



            MS Alam TRIVUz
            Founder,
            TRIVUz Academy
            trivuz@gmail.com

More Related Content

What's hot

Looping and Switchcase BDCR
Looping and Switchcase BDCRLooping and Switchcase BDCR
Looping and Switchcase BDCR
beriver
 
Jumping statements
Jumping statementsJumping statements
Jumping statements
Suneel Dogra
 
Chapter 8 - Conditional Statement
Chapter 8 - Conditional StatementChapter 8 - Conditional Statement
Chapter 8 - Conditional Statement
Deepak Singh
 

What's hot (20)

Statements and Conditions in PHP
Statements and Conditions in PHPStatements and Conditions in PHP
Statements and Conditions in PHP
 
09 ruby if else
09 ruby if else09 ruby if else
09 ruby if else
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception Handling in object oriented programming using C++
Exception Handling in object oriented programming using C++Exception Handling in object oriented programming using C++
Exception Handling in object oriented programming using C++
 
Java Decision Control
Java Decision ControlJava Decision Control
Java Decision Control
 
M C6java6
M C6java6M C6java6
M C6java6
 
Cse lecture-6-c control statement
Cse lecture-6-c control statementCse lecture-6-c control statement
Cse lecture-6-c control statement
 
Constructs (Programming Methodology)
Constructs (Programming Methodology)Constructs (Programming Methodology)
Constructs (Programming Methodology)
 
Decision Making Statement in C ppt
Decision Making Statement in C pptDecision Making Statement in C ppt
Decision Making Statement in C ppt
 
Looping and Switchcase BDCR
Looping and Switchcase BDCRLooping and Switchcase BDCR
Looping and Switchcase BDCR
 
Exception handling c++
Exception handling c++Exception handling c++
Exception handling c++
 
Using loops
Using loopsUsing loops
Using loops
 
Iteration Statement in C++
Iteration Statement in C++Iteration Statement in C++
Iteration Statement in C++
 
Jumping statements
Jumping statementsJumping statements
Jumping statements
 
Decision making and branching
Decision making and branchingDecision making and branching
Decision making and branching
 
Exception handling in c++
Exception handling in c++Exception handling in c++
Exception handling in c++
 
Exception handling
Exception handlingException handling
Exception handling
 
Mesics lecture 6 control statement = if -else if__else
Mesics lecture 6   control statement = if -else if__elseMesics lecture 6   control statement = if -else if__else
Mesics lecture 6 control statement = if -else if__else
 
Chapter 8 - Conditional Statement
Chapter 8 - Conditional StatementChapter 8 - Conditional Statement
Chapter 8 - Conditional Statement
 
Vb decision making statements
Vb decision making statementsVb decision making statements
Vb decision making statements
 

Viewers also liked

Conditional Statements
Conditional StatementsConditional Statements
Conditional Statements
micdsram
 
Binary octal
Binary octalBinary octal
Binary octal
drdipo4
 
Using the IF Function in Excel
Using the IF Function in ExcelUsing the IF Function in Excel
Using the IF Function in Excel
Casey Robertson
 
1st Test - If then, converse, inverse and contrapositive
1st Test - If then, converse, inverse and contrapositive1st Test - If then, converse, inverse and contrapositive
1st Test - If then, converse, inverse and contrapositive
Brandeis High School
 
Excel IF function
Excel IF functionExcel IF function
Excel IF function
Htay Aung
 
Introduction number systems and conversion
 Introduction number systems and conversion Introduction number systems and conversion
Introduction number systems and conversion
kanyuma jitjumnong
 

Viewers also liked (20)

Conditional Statements | If-then Statements
Conditional Statements | If-then StatementsConditional Statements | If-then Statements
Conditional Statements | If-then Statements
 
Conditional Statements
Conditional StatementsConditional Statements
Conditional Statements
 
Conditional statement
Conditional statementConditional statement
Conditional statement
 
C if else
C if elseC if else
C if else
 
CONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGECONDITIONAL STATEMENT IN C LANGUAGE
CONDITIONAL STATEMENT IN C LANGUAGE
 
Octal and Hexadecimal Numbering Systems
Octal and Hexadecimal Numbering SystemsOctal and Hexadecimal Numbering Systems
Octal and Hexadecimal Numbering Systems
 
Binary octal
Binary octalBinary octal
Binary octal
 
1.3.2 Conditional Statements
1.3.2 Conditional Statements1.3.2 Conditional Statements
1.3.2 Conditional Statements
 
Conditional Statements
Conditional StatementsConditional Statements
Conditional Statements
 
Using the IF Function in Excel
Using the IF Function in ExcelUsing the IF Function in Excel
Using the IF Function in Excel
 
Conditional statements
Conditional statementsConditional statements
Conditional statements
 
11 octal number system
11   octal number system11   octal number system
11 octal number system
 
1st Test - If then, converse, inverse and contrapositive
1st Test - If then, converse, inverse and contrapositive1st Test - If then, converse, inverse and contrapositive
1st Test - If then, converse, inverse and contrapositive
 
Excel IF function
Excel IF functionExcel IF function
Excel IF function
 
Number system conversion
Number system conversionNumber system conversion
Number system conversion
 
Introduction number systems and conversion
 Introduction number systems and conversion Introduction number systems and conversion
Introduction number systems and conversion
 
Number System
Number SystemNumber System
Number System
 
Loops in C
Loops in CLoops in C
Loops in C
 
Number system
Number systemNumber system
Number system
 
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates. Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.
 

Similar to Programming Basics if then else, switch, operators

Chapter 4 flow control structures and arrays
Chapter 4 flow control structures and arraysChapter 4 flow control structures and arrays
Chapter 4 flow control structures and arrays
sshhzap
 
Final project powerpoint template (fndprg) (1)
Final project powerpoint template (fndprg) (1)Final project powerpoint template (fndprg) (1)
Final project powerpoint template (fndprg) (1)
heoff
 
Fundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medinaFundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medina
rurumedina
 

Similar to Programming Basics if then else, switch, operators (20)

conditional_statement.pdf
conditional_statement.pdfconditional_statement.pdf
conditional_statement.pdf
 
Chapter 4 flow control structures and arrays
Chapter 4 flow control structures and arraysChapter 4 flow control structures and arrays
Chapter 4 flow control structures and arrays
 
Final project powerpoint template (fndprg) (1)
Final project powerpoint template (fndprg) (1)Final project powerpoint template (fndprg) (1)
Final project powerpoint template (fndprg) (1)
 
Lecture 8
Lecture 8Lecture 8
Lecture 8
 
05. Conditional Statements
05. Conditional Statements05. Conditional Statements
05. Conditional Statements
 
Chapter 00 revision
Chapter 00 revisionChapter 00 revision
Chapter 00 revision
 
Control Statement programming
Control Statement programmingControl Statement programming
Control Statement programming
 
Loops and conditional statements
Loops and conditional statementsLoops and conditional statements
Loops and conditional statements
 
Java Tutorial
Java TutorialJava Tutorial
Java Tutorial
 
Java_Tutorial_Introduction_to_Core_java.ppt
Java_Tutorial_Introduction_to_Core_java.pptJava_Tutorial_Introduction_to_Core_java.ppt
Java_Tutorial_Introduction_to_Core_java.ppt
 
Java tut1
Java tut1Java tut1
Java tut1
 
Java tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo CahersiveenJava tut1 Coderdojo Cahersiveen
Java tut1 Coderdojo Cahersiveen
 
Java tut1
Java tut1Java tut1
Java tut1
 
Javatut1
Javatut1 Javatut1
Javatut1
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 
Java tutorial PPT
Java tutorial  PPTJava tutorial  PPT
Java tutorial PPT
 
Chapter 03 conditional statements
Chapter 03   conditional statementsChapter 03   conditional statements
Chapter 03 conditional statements
 
Synapseindia reviews.odp.
Synapseindia reviews.odp.Synapseindia reviews.odp.
Synapseindia reviews.odp.
 
Fundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medinaFundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medina
 
02 - Prepcode
02 - Prepcode02 - Prepcode
02 - Prepcode
 

More from Trivuz ত্রিভুজ (6)

Web design basics 1
Web design basics 1Web design basics 1
Web design basics 1
 
Web design intro
Web design introWeb design intro
Web design intro
 
Database - Design & Implementation - 1
Database - Design & Implementation - 1Database - Design & Implementation - 1
Database - Design & Implementation - 1
 
Programming Basics - array, loops, funcitons
Programming Basics - array, loops, funcitonsProgramming Basics - array, loops, funcitons
Programming Basics - array, loops, funcitons
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Running @ maximum HP without Tearing Apart
Running @ maximum HP without Tearing ApartRunning @ maximum HP without Tearing Apart
Running @ maximum HP without Tearing Apart
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Recently uploaded (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 

Programming Basics if then else, switch, operators

  • 1. TRIVUz Academy PF02 Class Id: Programming Fundamentals MS Alam TRIVUz Founder, TRIVUz Network TRIVUz Academy
  • 2. TRIVUz Academy Recap PF01 TRIVUz Academy
  • 3. We learn before We Define Computer & Program Define Computer Programming Programming Process Programming Language Inputs & Outputs Define Logical Processing Variables Data Types Programming Fundamentals TRIVUz Academy www.trivuzacademy.com
  • 4. We will learn today Conditional Statement If… then … else Switch statement Operators Programming Fundamentals TRIVUz Academy www.trivuzacademy.com
  • 5. Conditional Statement • Conditional statements are the set of command used to perform different actions base on different conditions • In PHP we have the following conditional statements: • if • if else • else if • switch TRIVUz Academy
  • 6. If statement execute some code only if statement is true TRIVUz Academy
  • 8. If… if TRIVUz Academy
  • 9. If… if (conditional) TRIVUz Academy
  • 10. If… if (conditional) { TRIVUz Academy
  • 11. If… if (conditional) { // statement to be executed TRIVUz Academy
  • 12. If… if (conditional) { // statement to be executed } TRIVUz Academy
  • 13. If… Example: if ($math < 33) { $result = “Failed!”; } TRIVUz Academy
  • 14. If…else statement execute some code if statement is true and some other code if statement is false TRIVUz Academy
  • 15. If…else… if (conditional) { // statement if true } TRIVUz Academy
  • 16. If…else… if (conditional) { // statement if true } else TRIVUz Academy
  • 17. If…else… if (conditional) { // statement if true } else { // statement if false TRIVUz Academy
  • 18. If…else… if (conditional) { // statement if true } else { // statement if false } TRIVUz Academy
  • 19. If…else… Example: if ($math < 33) { $result = “Failed!”; } else { $result = “Passed!”; } TRIVUz Academy
  • 20. If…else if…else statement execute some code if statement is true And some other code if statement is false TRIVUz Academy
  • 21. If…else if…else if (conditional) { // statement if true } else if (conditional){ // statement if false and else if true } else { // statement if all false } TRIVUz Academy
  • 22. If…else if…else if (conditional) { // statement if true } else if (conditional){ // whichever matches first } else if (conditional){ // whichever matches first } else if (conditional){ // whichever matches first } else if (conditional){ // whichever matches first } else { // statement if all false } TRIVUz Academy
  • 23. If…else if…else Example: if ($avg > 100) { $grade = "Invalid"; } else if ($avg > 90 and $avg < 100 ) { $grade = "A+"; } else if($avg > 80 and $avg < 90) { $grade = "A"; } else { $grade = "F"; } TRIVUz Academy
  • 24. switch statement Select one of many block of code to execute TRIVUz Academy
  • 26. switch switch (value) TRIVUz Academy
  • 27. switch switch (value) { TRIVUz Academy
  • 28. switch switch (value) { case 1: // some code to execute TRIVUz Academy
  • 29. switch switch (value) { case 1: // some code to execute break; TRIVUz Academy
  • 30. switch switch (value) { case 1: // some code to execute break; case 2: // some code to execute break; TRIVUz Academy
  • 31. switch switch (value) { case 1: // some code to execute break; case 2: // some code to execute break; default: // nothing matches, do it TRIVUz Academy
  • 32. switch switch (value) { case 1: // some code to execute break; case 2: // some code to execute break; default:  similar to else in if..else // nothing matches, do it TRIVUz Academy
  • 33. switch switch (value) { case 1: // some code to execute break; case 2: // some code to execute break; default: // nothing matches, do it } TRIVUz Academy
  • 34. switch switch (n) { case label1: code to be executed if n=label1; break; case label2: code to be executed if n=label2; break; default: code to be executed if n is different from both label1 and label2; } TRIVUz Academy
  • 35. switch <html> <body> <?php switch ($x) { case 1: echo "Number 1"; break; case 2: echo "Number 2"; break; case 3: echo "Number 3"; break; default: echo "No number between 1 and 3"; } ?> </body> TRIVUz Academy </html>
  • 36. PHP Operators Operators are used to operate on values TRIVUz Academy
  • 40. Operators Logical Operators TRIVUz Academy
  • 41. Thank You MS Alam TRIVUz Founder, TRIVUz Academy trivuz@gmail.com

Editor's Notes

  1. ----- Meeting Notes (12/28/11 19:20) -----