$ A = 2; $ a = 1? $ Test = & quot; Enterprise & quot; :( $ a = 2? $ Test = & quot; Region & quot;: $ test = & quot; other places & quot;); echo $ test; first, judge whether $ a is 1. if it is a direct output enterprise. if it is not, then determine whether $ a is equivalent to another nested if in else. if it is equal to $ a = 2; $ a = 1? $ Test = "enterprise": ($ a = 2? $ Test = "region": $ test = "other places"); echo $ test; first, judge whether $ a is 1. if it is a direct output enterprise, if it is not to continue to judge, it is equivalent to embedding another if in else. if it is equal to 2, the output area is equivalent to $ a = 2 if it is not the output area. if ($ a = 1) {echo $ test = "enterprise";} else {if ($ a = 2) {$ test = "region ";} else {$ test = "other places" ;}} echo $ test; or if ($ a = 1) {echo $ test = "enterprise ";} else {$ a = 2? $ Test = "region": $ test = "other places ";}
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