PHP 输出字符串

2025-06-21 01:34:10
推荐回答(2个)
回答1:

这是php的定界符

不是没输出,是报错了,你没开报错提示:
Parse error: syntax error, unexpected T_SL in C:\wamp\www\index.php on line 2
语法错误。

原因有2个:
$str= 这里多一个空格,所以出错了
而且<<
$str=<< Hello, this is an example for HEREDOC Syntax.
Please attention to it.
EOD;
echo $str;
?>

你看看这个人写的,挺好:http://apps.hi.baidu.com/share/detail/18048533

回答2:

print