Blogger Information
Blog 16
fans 0
comment 2
visits 16307
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
PHP分支流程控制判断
长沙php专家
Original
909 people have browsed it

PHP分支流程控制判断

$dollar='1000';  //先声明一个变量

if ($dollar > 900){ //定义一个条件

echo '<p font-color="red";>你就是富翁</p>';

}else {

echo '<p font-color="red";>你就不是富翁</p>';

}


$MissZhong = '10000';


if ($MissZhong = '10000'){


echo '<p style="color:red";>真的臭蛋</p>';


}else if ($MissZhong >='10000' && $MissZhong < '20000'){  //多分支


echo '<p style="color:green";>大大的臭蛋</p>';


}

$MissZhong = '1000000';

switch ($MissZhong){ 

    case '10000':   //case是定义一个条件   

echo '<p style="color:red";>小钟是真的臭蛋</p>';

    break;


    case '1000':

    echo '<p style="color:black";>小钟是小老婆</p>';  //变色

    break;


    default;

    echo '<p style="color:yellow";>小钟是小老婆</p>';    //变色

    break; 

}



Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post