note 48628 deleted from function.max by nlopess
| From: | nlopess@php.net | Date: | Sun, 02 Jan 2005 18:48:04 +0000 |
| Subject: | note 48628 deleted from function.max by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-82609@lists.php.net to get a copy of this message | ||
Note Submitter:
----
Another way to get maximum value from 3 variables:
<?php
$max = $r > $g ? ($r > $b ? $r : $b) : ($b > $g ? $b : $g);
?>
This is as fast as using:
<?php
$max = max($r, $g, $b);
?>
----
Reason: useless example