A little doubt about the include ()

Source: Internet
Author: User
Tags parse error
This code I saved to a file named 1.php, run this file will be error (Parse error:syntax error)


  
   

The following code I saved to a file named 2.php (in the same directory as 1.php), my file in 2.php include()


  
   

According to the truth, the report will echo the results of the error, but I am in the actual operation, the page only error. Ask the great God for advice, this is why AH.

Reply content:

This code I saved to a file named 1.php, run this file will be error (Parse error:syntax error)


  
   

The following code I saved to a file named 2.php (in the same directory as 1.php), my file in 2.php include()


  
   

According to the truth, the report will echo the results of the error, but I am in the actual operation, the page only error. Ask the great God for advice, this is why AH.

Include introduced sub-page error, the program will continue to execute,
If you use require, you won't perform the following.

The first file is no problem. The PHP end tag does not require a symbol.

The second file is not a problem.

So the first file outputs "1", and the second file outputs "11", which is the same as my test results.

The problem with this is not the problem with the code itself (probably the wrong one?). Special characters? Different configuration? )。

  • 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.