Home  >  Article  >  Backend Development  >  PHP ternary operator in detail_PHP tutorial

PHP ternary operator in detail_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:13:141471browse

This article introduces operators. This is PHP ?:Run. It is also called the ternary or ternary operator. Friends who need to learn can refer to it.

The very simple ternary operator is also what we often talk about? : Operator

 代码如下 复制代码
$a=1;$b=2;$c=3;$d=4;
echo $a<$b?'xx':$a<$c?'yy':$a<$d?'zz':'oo';
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629226.htmlTechArticleThis article introduces about operators, which is php?:run, also called ternary or ternary Operators, friends who need to learn can refer to it. The very simple ternary operator is what we often say...
Statement:
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