What is the case, the PHP code is mixed with the HTML code

Source: Internet
Author: User
This is what happens when the PHP code and the HTML code are mixed together
The code below, PHP functions and HTML code mixed together, how to explain?
I just self-taught PHP, some of the here do not understand, but also hope that you are not hesitate to enlighten.

Public Function Displaystyles ()
{
?>

}

Public Function Displayheader ()
{
?>

cellspacing= "0" border= "0" >



TLA Consulting Pty LTD






}

------Solution--------------------
Yes, that's OK, for example.
$a = 3;
$b = 5;
if ($a > $b)
{
?>

Hello


}
Else
{
?>

World


}
?>

PHP language skills, sometimes it is very convenient to do so, you write more PHP, you will find the beauty of it
I'm not used to it at first, it's normal.
------Solution--------------------
You can put
function () {? >hello ' world
 
  

function () {echo ' hello\ ' World ';}

This is also for the sake of brevity, think, a string contains a lot of single double quotes, then how much trouble ah

------Solution--------------------
Your question is reasonable.

What does PHP do?
PHP is a widely used, open-source, multi-purpose scripting language that can be embedded in HTML, especially for Web development.

So embedding HTML code in the PHP code is really nondescript.
------Solution--------------------
References:
Reference: Yes, this is OK, for example
$a = 3;
$b = 5;
if ($a > $b)
{
?>

Hello


}
Else
{
  • 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.