下面是一个错误的代码,能看出哪里出错了么??对于我这个初学者什么都是蒙蒙懂的,真的无从下手,但是真的要自己尝试了才知道哪里错了,书和教程都不会告诉我哪里错了
错误代码: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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

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

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

WebStorm Mac version
Useful JavaScript development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
