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? what if I want to write it like this? Include all of these in one & amp; lt ;? Php? & Amp; gt; so...
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? what if I want 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 content:
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? what if I want 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?
One is PHP code and the other is HTML code. If you want to write HTML code to the PHP code block, you must useecho
Wrap up the HTML code. But writing the PHP interpreter will automatically process the HTML code in the middle, saving a lot of trouble and making it clear.
Php and html hybrid writing
It must be separated by the start and end characters of the PHP file.
This method is what you met. when you encounter html content, such as while and for, you have to finish it.
Either use html as a string in php
***" }?>
The text outside the php tag is treated as text, so}
Is part of php, with 39th rowswhile
Pairing.
In fact, there can be a more elegant way:Alternative syntax.
Some html code
Value $ _ GET ['A'] is
Forif
,for
And other statements.
The template is introduced to avoid splicing html in the code.
This is the html output in php.