Home > Backend Development > PHP Tutorial > php三元运算符

php三元运算符

WBOY
Release: 2016-06-06 20:36:36
Original
1302 people have browsed it

php三元运算符

帮朋友问的。不清楚怎么讲。

回复内容:

php三元运算符

帮朋友问的。不清楚怎么讲。

这是 PHP 新版本增加的特性, $a ?: $b 就相当于 $a ? $a : $b 。一般用来判断值是否存在给默认值的时候比较方便。

http://php.net/manual/zh/language.operators.comparison.php#language.op...

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template