In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, the editor will bring you about what the two question marks in php refer to. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
The two question marks in php are a new NULL merge operator introduced by php7, which is used in ways such as "$username = $_ GET ['user']?' nobody';".
This article operating environment: Windows7 system, PHP7.1 version, Dell G3 computer.
What do two question marks mean in php?
Actually, two question marks? Is a new expression from php7:
An additional NULL merge operator has been added in the PHP7+ version. An example is as follows:
Example
Php7 used to use ternary expressions frequently:
Ternary operator:
Another conditional operator is the "?:" (or ternary) operator.
Grammatical format
(expr1)? (expr2): (expr3)
The value is expr2 when expr1 is evaluated as TRUE and expr3 when expr1 is evaluated as FALSE.
As of PHP 5.3, the middle part of the ternary operator can be omitted. The expression expr1?: expr3 returns expr1 when expr1 evaluates to TRUE, otherwise it returns expr3.
This is what the two question marks in the php shared by the editor refer to. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.