我这里输出结果没有换行,在最后面加个\n排版就会更清晰了 例如echo "在跑第".$i."圈。\n";
2017-12-20
在php中字符串连接符是用点(.)来表示的,这一点比较特殊,其它语言中是用加号(+)来表示的,比如:JavaScirpt、Asp、C。
2017-12-20
apache无法启动,即显示橙色的,可能是你的目录名是“中文”,这很重要,因为Windows系统支持中文文件夹,希望能解决一部分同学的难点
2017-12-18
<?php
$num_float = 1.234;
echo $num_float1;
echo "<br />";
$num_float = 1.2e3;
echo $num_float2;
echo "<br />";
$num_float = 7.0E-10;
echo $num_float3;
echo "<br />";
?>
$num_float = 1.234;
echo $num_float1;
echo "<br />";
$num_float = 1.2e3;
echo $num_float2;
echo "<br />";
$num_float = 7.0E-10;
echo $num_float3;
echo "<br />";
?>
2017-12-17
这到题没错,不要纠结中或底。$height = "中"; 这里已经定义了好了,下面的判断就是取$p = "PI1";
define("PI1",3.14);
define("PI2",3.142);
$height = "jl";
if($height == "中"){
$p = "PI1";
}elseif($height != "中"){
$p = "PI2";
}
$r = 1;
$area = constant($p)*$r*$r;
echo $area;
define("PI1",3.14);
define("PI2",3.142);
$height = "jl";
if($height == "中"){
$p = "PI1";
}elseif($height != "中"){
$p = "PI2";
}
$r = 1;
$area = constant($p)*$r*$r;
echo $area;
2017-12-15
$file_handle = fopen("D:\Demo\re.txt”,"r");
if($file_handle){
while(!feof($file_handle)){
$line = fgets($file_handle);
echo $line;
echo "<br />";
}
fclose($file_handle);
}
Warning: fopen(D:\Demo e.txt): failed to open stream: Invalid argument in D:\untitled\test.。
if($file_handle){
while(!feof($file_handle)){
$line = fgets($file_handle);
echo $line;
echo "<br />";
}
fclose($file_handle);
}
Warning: fopen(D:\Demo e.txt): failed to open stream: Invalid argument in D:\untitled\test.。
2017-12-15