The following is an error code. can you see what went wrong ?? I am a beginner and have no idea what to do. but I have to try it myself to find out what is wrong. neither the book nor the tutorial will tell me where the error code is: Parse error: syntax error, unexpected $ end in H: \ wamp \ www \ testing \ test \ 2.1.4.php on line 16
Error source code:
The code is as follows:
$ Str = <
Test string
Test string
Test string
EOD;
Echo $ str;
// Defines the variables used for the delimiters
$ Name = 'Einstein ';
$ Dicta = "Imagination is more important than knowledge, because knowledge is limited, and imagination is unlimited ";
$ Size = 5;
Echo <
Said: "{$ dicta }"
EOT;
?>
Eclipse error Image
Incorrect image
This error is actually very simple, that is, when the delimiter EOD and EOT end, the front side adds a Tab, the solution is to write "EOD;" and "EOT;" at the top ;". I believe that beginners have the same experience as me ......
Correct code:
The code is as follows:
$ Str = <
Test string
Test string
Test string
EOD;
Echo $ str;
// Defines the variables used for the delimiters
$ Name = 'Einstein ';
$ Dicta = "Imagination is more important than knowledge, because knowledge is limited, and imagination is unlimited ";
$ Size = 5;
Echo <
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service