Home > php教程 > php手册 > php三目运算符详细

php三目运算符详细

WBOY
Release: 2016-05-25 16:46:51
Original
2586 people have browsed it

本文章介绍了关于运算符,这是php ?:运行哦,也称为三目或三元运算符,有需学习的朋友可以参考一下.

很简单的三目运算符也是我们常说的?:运算符了

实例代码如下:

<?php  
	$a=1;$b=2;$c=3;$d=4;  
	echo $a<$b?&#39;xx&#39;:$a<$c?&#39;yy&#39;:$a<$d?&#39;zz&#39;:&#39;oo&#39;;  
	 
Copy after login


 
Related labels:
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template