php switch语句示例
php switch语句示例 [代码片段(20行)]
<html>
<head>
<title>A switch Statement</title>
</head>
<body>
<?php
$mood = 'sad';
switch ( $mood ) {
case 'happy':
print 'I'm in a good mood';
break;
case 'sad':
print 'Don't be down!';
break;
default:
print 'Neither happy nor sad but $mood';
}
?>
</body>
</html>
- 上一篇:php计算两个坐标(经度,纬度)之间的距离
- 下一篇:php默认参数方法
精彩图集
精彩文章






