USING CONDITIONAL CODE
CONDITIONAL CODE
If( ) {
}
condition
// your additional code goes here
// . . .
TERMINOLOGY
parentheses
brackets
braces
( )
{ }
[ ]
CONDITIONAL CODE
If( ) {
}
condition
echo “it’s true!”;
// . . .
$a < 50$b > 20
true or false?
$c == 99$c === 99$d != 100 ...
EQUALITY
If( $a == $b ){
// execute this code
}
ASSIGNMENT INSTEAD OF EQUALITY
$a = 5;
$b = 10;
If( $a = $b ){
// always true!
}
OPERATOR WITH =
= assignment
== equality
=== strict equality
COMPARISON
If( $a == $b ){ …
If( $a != $b ){ …
If( $a === $b ){ …
If( $a !== $b ){ …
If( $a > $b ){ …
If( $a < $b ){ …
If(...
LOGICAL AND / OR
If( $a === $b $c === $d){…
If( $a === $b $c === $d){…
If( ($a > $b) && ($c > $d) ){…
and&&
or||
assingment
• Mark Sheet
• Even Numbers and Odd Numbers Series
• Prime Number Series
• Fibonacci Number Series
• Generate S...
Upcoming SlideShare
Loading in...5
×

php-3 Looping and Branching

291

Published on

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

  • Be the first to like this

No Downloads
Views
Total Views
291
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
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
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×