[英]such a simple code of php is printing weird things out.i m not able to figure out why is this happening?
PHP代码来打印简单的字符串!
<!DOCTYPE html>
<html>
<body>
<?php
$color="red"; //just a simple variable//
echo "My car is " . $color . "<br>";
echo "My house is " . $color . "<br>";
echo "My boat is " . $color. "<br>";
?>
</body>
</html><!end of html>
上面的代码给出了错误的输出,可能是什么原因? 输出:
“; echo”我的房子是“。$ color。”“; echo”我的船是“。$ color。”“;?>
<!DOCTYPE html>
<html>
<body>
<?php
$color="red"; //just a simple variable//
echo "My car is " . $color . "<br>";
echo "My house is " . $color . "<br>";
echo "My boat is " . $color. "<br>";
?>
</body>
</html><!end of html>
另存为
demo.php in htdocs
执行http://localhost/demo.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.