下面是一个错误的代码,能看出哪里出错了么??对于我这个初学者什么都是蒙蒙懂的,真的无从下手,但是真的要自己尝试了才知道哪里错了,书和教程都不会告诉我哪里错了
错误代码:Parse error: syntax error, unexpected $end in H:\wamp\www\testing\test\2.1.4.php on line 16
错误源代码:
代码如下:
$str =
测试字符串
测试字符串
测试字符串
EOD;
echo $str;
//为定界符定义使用的变量
$name = '爱因斯坦';
$dicta = "想象力比知识更重要,因为知识是有限的,而想象力是无限的";
$size = 5;
echo
said:"{$dicta}"
EOT;
?>
Eclipse错误图片
错误图片
这个错误其实很简单,就是在定界符EOD和EOT结尾时,前边 加了Tab,解决办法是顶格写 "EOD;" 和"EOT;" 。相信各位初学者也有和我一样的经历吧……
正确代码:
代码如下:
$str =
测试字符串
测试字符串
测试字符串
EOD;
echo $str;
//为定界符定义使用的变量
$name = '爱因斯坦';
$dicta = "想象力比知识更重要,因为知识是有限的,而想象力是无限的";
$size = 5;
echo
said:"{$dicta}"
EOT;
?>
结果截图:

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver CS6
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
