Re: Determine variable with the lowest value?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 14 October 2004 06:19, BOOT wrote:

[snip]

> I have been able to do this by means of if comparisons but the more I
> variables I add then the more complicated and messy it becomes. There has
> to be a simpler way. If it makes any difference, the variables could just
> as easily be array elements.

So stick them into an array and use one of the many array functions.

> the code should determine that $a and $b have the lowest value, and
> randomly pick one of them. if $a was = 1 instead then it would just pick $a

The "randomly pick one" part you would have to code yourself.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
It's amazing how much better you feel once you've given up hope.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux