Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

PHP Lecture 2 - Conditional Statement, Loop

PHP Lecture 2 - Conditional Statement, Loop, if Statement, if-else statement, Nested if-else, Switch statement, For loop, while loop, do while loop, foreach loop

  • Login to see the comments

PHP Lecture 2 - Conditional Statement, Loop

  1. 1. WEB DEVELOPMENT
  2. 2. PHP PRESENTATORS MD. AL-MAMUN SARKAR
  3. 3. PHP Conditional Statement Loop 1 2
  4. 4. Conditional Statement if Statement if-else statement 1 2 Nested if-else3 Switch4
  5. 5. if statement if (condition) { code to be executed if condition is true; } 2
  6. 6. if-else statement if (condition) { code to be executed if condition is true; } else { code to be executed if condition is false; } 2
  7. 7. Nested if-else if (condition) { code to be executed if this condition is true; } elseif (condition) { code to be executed if this condition is true; } else { code to be executed if all conditions are false; }
  8. 8. Nested if-else switch (n) { case label1: code to be executed if n=label1; break; case label2: code to be executed if n=label2; break; case label3: code to be executed if n=label3; break; ... default: code to be executed if n is different from all labels; } 2
  9. 9. Loops while loop2 do while loop3 foreach4 For loop1
  10. 10. While Loop while (condition is true) { code to be executed; }
  11. 11. For Loop for (init counter; test counter; increment counter) { code to be executed; }
  12. 12. Do while Loop do { code to be executed; } while (condition is true);
  13. 13. Foreach Loop foreach ($array as $value) { code to be executed; }
  14. 14. QUESTION ?
  15. 15. THANK YOU

×