Why does this code suddenly end when it is written here?

Source: Internet
Author: User
Why does this code suddenly end when it is written here? In the picture, why is the ending Mark written in the curly braces at the beginning of the while loop? the ending curly braces at the end of the while loop are separately included by the php tag. why is the independent php tag in the while execution statement? to write it like this, include all of these in one Isn't it possible to write such a label? I often don't know how to write it in this way. can you explain it to me?


Reply to discussion (solution)

Mixed HTML and PHP code
Can be contained in one

Hybrid HTML and PHP writing

Php + html hybrid writing. if you are familiar with the php framework, this problem is well avoided.

Mixed HTML and PHP code
Can be contained in one


Why not write them together...

Mixed HTML and PHP code
Can be contained in one


Why not write them together...

We need to follow the regular routine.

Because the html in it is something to be recycled.

This is a mix of php and html.
Directly The line does not work, of course, but in this case, you need to write echo to handle quotation marks escape and other issues.

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.