Can PHP code be written like this? Today I learned a piece of weird code.

Source: Internet
Author: User
Can PHP code be written like this ?? Today I learned a piece of weird code & lt ;? Php & nbsp; if & nbsp; (5 & lt; 4) & nbsp ;{? & Gt; & lt; div & gt; my name is Interface 1 & lt;/div & gt; & lt ;? Php & nbsp ;}& nbsp; else & nbsp ;{& nbsp ;? & Gt; can PHP code be written like this ?? Today I learned a piece of weird code.


I am the first interface

I am a user on interface 2



PHP syntax is not
 

Is that true?

 
 
What does this mean? There is an extra {number.

------ Solution --------------------
The landlord asked, "there is an extra {number in it"
Who have answered?
Don't think it's a small section, experience is accumulated
If you do not see the problem clearly, you can propose a solution that will never succeed!
------ Solution --------------------
When multiple lines of code are executed when the condition is true or fails, these lines of code must be included in curly brackets. At present, this mixed compilation method is missing.
------ Solution --------------------
Reference:
The landlord asked, "there is an extra {number in it"
Who have answered?
Don't think it's a small section, experience is accumulated
If you do not see the problem clearly, you can propose a solution that will never succeed!

This is not too many. isn't it added by the multi-line code behind the if statement,
This should be the original intention of PHP. process-oriented and efficiency-oriented,
There are still many frameworks like this, such as CI

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.