<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Echo语句</title>
</head>
<body>
<p>
<?php echo "Welcome to imooc!"; ?>
</p>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Echo语句</title>
</head>
<body>
<p>
<?php echo "Welcome to imooc!"; ?>
</p>
</body>
</html>
2017-04-21
foreach($students as $key => $val){
echo $key.":".$val[0].$val[1];
echo "<br>";
}
echo $key.":".$val[0].$val[1];
echo "<br>";
}
2017-04-21
ini_set('track_errors', 1); //开启php的服务track_error。
error_reporting(E_ALL^E_NOTICE^E_WARNING);
//可以关闭所有notice 和 warning 级别的错误。
//禁用错误报告
error_reporting(0);
//报告运行时错误
error_reporting(E_ERROR | E_WARNING | E_PARSE);
//报告所有错误
error_reporting(E_ALL);
error_reporting(E_ALL^E_NOTICE^E_WARNING);
//可以关闭所有notice 和 warning 级别的错误。
//禁用错误报告
error_reporting(0);
//报告运行时错误
error_reporting(E_ERROR | E_WARNING | E_PARSE);
//报告所有错误
error_reporting(E_ALL);
2017-04-20
<?php
date_default_timezone_set('Asia/ShangHai');
$today = date('m-d',time());//获取当天日期
$birthday = "04-20";//生日
$money = 238;//消费金额
$discount = 0.8;//八折优惠
if($today==$birthday){
$money=$money*$discount;
}else{$money=$money*1;};
echo $money;
?>
date_default_timezone_set('Asia/ShangHai');
$today = date('m-d',time());//获取当天日期
$birthday = "04-20";//生日
$money = 238;//消费金额
$discount = 0.8;//八折优惠
if($today==$birthday){
$money=$money*$discount;
}else{$money=$money*1;};
echo $money;
?>
2017-04-20
Parse error: syntax error, unexpected ';' (T_STRING) in /54/884/Kh7j/index.php on line 9
2017-04-20
<?php
$love = "I love you!";
$string1="慕课网,$love";
$string2='慕课网,$love';
echo $string1;
echo "<br />";
echo $string2;
?>
$love = "I love you!";
$string1="慕课网,$love";
$string2='慕课网,$love';
echo $string1;
echo "<br />";
echo $string2;
?>
2017-04-20