PHPsyntaxerror, unexpected $ end error and solution _ PHP Tutorial

Source: Internet
Author: User
Tags parse error
PHPsyntaxerror and unexpected $ end are one of the reasons for the error and solutions. Parseerror: syntaxerror, unexpected $ endinscript. phponlinexx after debugging for a while, it is found that the row that produces the error is a line in the middle of the file $ str .? N; think of the Parse error: syntax error, unexpected $ end in script. PHP on line xx allowed by the php interpreter.
After debugging for a while, it is found that the line that produces the error is a line in the middle of the file.

// $ Str. = "?> \ N ";

Think of the line that the PHP interpreter allows to end with a single line comment, that is, // $ str. = "?> \ N "; is interpreted as a comment before the end mark. the comment content is // $ str. =", and?> \ N "; will be interpreted as HTML output for content outside the PHP block! The result is $ str. = "?> \ N "; after this line is added/annotated, there will be more?> The end mark of, resulting in the original real end mark as unexpected (unexpected.
The solution is to delete this line directly.

It is a good habit to write other things in the row where the PHP start and end tags are located.

Http://www.bkjia.com/PHPjc/319614.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/319614.htmlTechArticleParse error: syntax error, unexpected $ end in script. php on line xx after debugging for a while, the line that produces the error is a line in the middle of the file // $ str. = "? \ N "; remembered what the PHP interpreter allowed...

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.