Home > Backend Development > PHP Tutorial > 三个变量看哪位高手最小

三个变量看哪位高手最小

WBOY
Release: 2016-06-13 12:22:52
Original
1003 people have browsed it

三个变量看谁最小。
变量a,变量b,变量c

最后,输出变量A最小,变量B最小。或变量C最小

最后,不是取变量里面的最小的值!

------解决思路----------------------

$a = 3;<br />$b = 4;<br />$c = 2;<br /><br />if($a == min($a, $b, $c)) echo '$a 最小';<br />if($b == min($a, $b, $c)) echo '$b 最小';<br />if($c == min($a, $b, $c)) echo '$c 最小';<br />
Copy after login
$c 最小

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