三个变量看谁最小。

WBOY
Release: 2016-06-23 13:31:03
Original
1129 people have browsed it

变量a,变量b,变量c

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

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


回复讨论(解决方案)

$a = 3;$b = 4;$c = 2;$r = array('a' => $a, 'b' => $b, 'c' => $c);echo array_search(min($r), $r); //c
Copy after login

$a = 3;
$b = 4;
$c = 2;
if($a最小){
}
if($b最小){
}
if($c最小){
}
是这个意思,这个如果写呢?

$a = 3;$b = 4;$c = 2;if($a == min($a, $b, $c)) echo '$a 最小';if($b == min($a, $b, $c)) echo '$b 最小';if($c == min($a, $b, $c)) echo '$c 最小';
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