Beruflich Dokumente
Kultur Dokumente
String Manipulation
Logical Operations
These are evaluated as being either True or False(1 or 0), and can help alter the flow of
your program using conditional statements
Robert
adhi
kusuma
putra
ra thought of leaving his house robert adhi want
photos and writing from right foot stepped
outside the room where where rt rw want to
mate with the goal going into sudirman Thamrin
Kebayoran Lama Petukangan red pal Unilever
bans new market developments Hotel Indonesia
roundabout Gatot Subroto wish to see Television
want to go to the mandir room is always
followed by the army commander was shot from
his room to get out of writing and his
subordinates followed
String Logical Operators
The same operators are different when a variable does not contain numbers.
$foo = $a+5;
$foo++;
$foo += 10;
$foo = "fu" . "bar";
$foo .= "bar";
if ($foo==5){}
if ($foo>10){}
if ($foo>2 && $foo<=5){}
if ($foo!=8){}
if ($foo eq "bar"){}
if ($foo ne "foobar"){}
Statement Blocks
As you just saw with the if (){}, the {} represents a statement block. Inside this can be 1
or more instructions. They can be used with flow control statements, such as if to allow
your program to have logical flow.
Flow Control
You can use the if statement together with logical operators and a statement block to add
control to your program. An example is:
if ($foo==5){
print "foo is 5";
}
Any combination of logical operators can be used as long as there is only one end result.
This may mean using more than one set of parentheses.