<?php
$p="";
//定义圆周率的两种取值
define("PI1",3.14);
define("PI2",3.142);
//定义值的精度
$height = "高";
//根据精度返回常量名,将常量变成了一个可变的常量
if($height == "中"){
$p = "PI1";
}else if($height == "低"){
$p = "PI2";
}else if($height =="高"){
$p = 5;
}
$r=1;
$area = constant($p)*$r*$r;
echo $area;
?>
KevenHuang
慕的地6079101
F粑粑
禅禅
stella_15