What is the situation? PHP code and HTML code are mixed together.

Source: Internet
Author: User
What is the situation? the code for mixing PHP code with HTML code is as follows. the PHP function and HTML code are mixed together. how can this problem be explained? I just learned PHP by myself, but I don't understand it here. I hope you will not be enlightened. & Nbsp; public & nbsp; function & nbsp; DisplayStyles () & n What is the situation? PHP code and HTML code are mixed together.
The code is as follows. PHP functions and HTML code are mixed. how can this problem be solved?
I just learned PHP by myself, but I don't understand it here. I hope you will not be enlightened.

  public function DisplayStyles()
  { 
?>   
  
  }

  public function DisplayHeader()
  { 
?>   
            cellspacing="0" border="0">
  
    
    
        TLA Consulting Pty Ltd
    
    
  
  
  }

------ Solution --------------------
Yes, this is acceptable, such
$ A = 3;
$ B = 5;
If ($ a> $ B)
{
?>
Hello
}
Else
{
?>
World
}
?>

Php skills. sometimes it is very convenient to do so. after you write more php, you will find it wonderful.
Not used to at first. it's normal.
------ Solution --------------------
You can
Function () {?> Hello 'world
 
PHP code
function(){ echo 'hello\'world'; }

This is also intended to be concise. think about it. a string contains many single double quotes, which can be a little complicated.

------ Solution --------------------
Your questions are reasonable.

What does php do?
Php is a widely used open-source multi-purpose scripting language. it can be embedded in HTML and is especially suitable for web development.

So embedded HTML code in php code is indeed not a child
------ Solution --------------------
Reference:
Reference: Yes, this is acceptable, such
$ 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.