Today's Lesson: PHP 3-Day Foundation Consolidation video Tutorial "Yan 18"
1, arithmetic operators/subtraction, etc., divisor cannot be 0
2 comparison operators
$a = 5;
$b = 3;
$c = ($a > $b);
Var_dump ($c);
echo ' <br/> ';
$c = ($a = = $b);
Var_dump ($c);
echo ' <br/> ';
All equals
$a = 5;
$b = ' 5 ';
Var_dump ($a = = $b);
Var_dump ($a = = = $b);
echo ' <br/> ';
All equals the requirement type and value all want to wait
Interview questions
$a = 0;//1 2 3 false
if ($a = = = False) {
echo ' not found ';
}else{
Echo ' found it ';
}
33-tuple operator
Ternary operators
Given 2 numbers, find the bigger one.
$a = 5;
$b = 10;
$c = null;
if ($a >= $b) {
$c = $a;
}else{
$c = $b;
}
Var_dump ($c);
$c = ($a >= $b? $a: $c);
Var_dump ($c);
echo ' <br/> ';
4 logical operators
logical operators
You can marry a car if you have a room.
$h = true;
$c = true;
if ($h = = = True) {
if ($c = = = True) {
echo "married";
}else{
echo "regret";
}
}
if ($h = = False) && ($c = = true)) {
Echo ' Marry ';
}else{
echo ' regret ';
}
The fourth day, learning less today, mainly is sleepy, or did not give up
This article from "A Big big waste fish" blog, declined reprint!
Abandoned fish--how long does PHP take to get from getting started to giving up? 4