Super simple php program! But an error is reported! -Php Tutorial

Source: Internet
Author: User
Super simple php program! But an error is reported! If ($ _ COOKIE ['onclick _ Button_ID '] = "btn-newquestion ")
{
$ Display_block = <
Cnm
END_OF_TEXT;
Echo $ display_block;
}
Else if ($ _ COOKIE ['onclick _ Button_ID '] = "btn-viewquestion ")
{
$ Display_block = <
Qnmd
EOF;
Echo $ display_block;
}
?>

In this case, we will report:
Parse error: syntax error, unexpected end of file in C: \ wamp \ www \ Zhuzhenqi \ Modal_Content.php on line 16

But when I change it like this, that's right:
If ($ _ COOKIE ['onclick _ Button_ID '] = "btn-newquestion ")
{
$ Display_block = <
Cnm
END_OF_TEXT;
Echo $ display_block;
}
Else if ($ _ COOKIE ['onclick _ Button_ID '] = "btn-viewquestion ")
{
Echo $ display_block;
}
?>

But I did not see it.
$ Display_block = <
Qnmd
EOF;
What's the problem?


Reply to discussion (solution)

There is a space before or after the end of the separator

Delete the space behind the EOF;

Cnm qnmd
These two strings are recognized by the system. now it is a Chinese society. php does not allow swearing characters, so they are blocked!

Okay, it means it has never been used <learned

There is a space behind the separator. check it yourself.

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.