Home > Backend Development > PHP Tutorial > php实现用三元运算符求三个数中的最大值,最小值

php实现用三元运算符求三个数中的最大值,最小值

WBOY
Release: 2016-06-23 13:11:41
Original
5068 people have browsed it

$a = 12;$b = 26;$c = 10;//求三个数中的最大值:echo $a>$b?($a>$c?$a:$c):($b>$c?$b:$c);//求三个数中的最三小值;echo $a<$b?($a<$c?$a:$c):($b<$c?$b:$c);
Copy after login


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