[PHP典型模塊與項目實戰大全]-第三章(if else判斷式)
[PHP典型模塊與項目實戰大全]-第三章(if else判斷式)
code2html:http://tohtml.com/
if else 判斷式
<?php
$a=1;
$b=1;
if($a>$b)
{
echo "a is bigger than b";
}elseif($a==$b)
{
echo "a is equal to b";
}else
{
echo "a is smaller than b";
}
echo "<br>";
$a=2;
$b=1;
if($a>$b)
{
echo "a is bigger than b";
}elseif($a==$b)
{
echo "a is equal to b";
}else
{
echo "a is smaller than b";
}
echo "<br>";
$a=1;
$b=3;
if($a>$b)
{
echo "a is bigger than b";
}elseif($a==$b)
{
echo "a is equal to b";
}else
{
echo "a is smaller than b";
}
echo "<br>"."-----------------------"."<br>";
$a=1.1;
$b=3.2;
if($a>$b)
{
echo "a is bigger than b";
}elseif($a==$b)
{
echo "a is equal to b";
}else
{
echo "a is smaller than b";
}
echo "<br>"."-----------------------"."<br>";
$a="A";
$b="B";
if($a>$b)
{
echo "a is bigger than b";
}elseif($a==$b)
{
echo "a is equal to b";
}else
{
echo "a is smaller than b";
}
echo "<br>"."-----------------------"."<br>";
?>