php-3 Looping and Branching

345 views
319 views

Published on

Published in: Education, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
345
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
7
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

php-3 Looping and Branching

  1. 1. USING CONDITIONAL CODE
  2. 2. CONDITIONAL CODE If( ) { } condition // your additional code goes here // . . .
  3. 3. TERMINOLOGY parentheses brackets braces ( ) { } [ ]
  4. 4. CONDITIONAL CODE If( ) { } condition echo “it’s true!”; // . . . $a < 50$b > 20 true or false? $c == 99$c === 99$d != 100 Code block
  5. 5. EQUALITY If( $a == $b ){ // execute this code }
  6. 6. ASSIGNMENT INSTEAD OF EQUALITY $a = 5; $b = 10; If( $a = $b ){ // always true! }
  7. 7. OPERATOR WITH = = assignment == equality === strict equality
  8. 8. COMPARISON If( $a == $b ){ … If( $a != $b ){ … If( $a === $b ){ … If( $a !== $b ){ … If( $a > $b ){ … If( $a < $b ){ … If( $a >= $b ){ … If( $a <= $b ){ …
  9. 9. LOGICAL AND / OR If( $a === $b $c === $d){… If( $a === $b $c === $d){… If( ($a > $b) && ($c > $d) ){… and&& or||
  10. 10. assingment • Mark Sheet • Even Numbers and Odd Numbers Series • Prime Number Series • Fibonacci Number Series • Generate Star Pyramid • electricity billing system

×