472,958 Members | 1,800 Online

# min and max functions

If I have a series of integers, how do I get the minimum (or maximum) value
NOT equaled to 0??
--
Alexander Ross
al******@bleen.net
Jul 16 '05 #1
4 2646
Alexander Ross wrote:
If I have a series of integers, how do I get the minimum (or maximum) value
NOT equaled to 0??

Are they in an array? comma separated string? other?

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 16 '05 #2
other ... 3 variables with integer values

"Justin Koivisto" <sp**@koivi.com> wrote in message
news:yV****************@news7.onvoy.net...
Alexander Ross wrote:
If I have a series of integers, how do I get the minimum (or maximum) value NOT equaled to 0??

Are they in an array? comma separated string? other?

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 16 '05 #3
> If I have a series of integers, how do I get the minimum (or maximum)
value
NOT equaled to 0??

You could stuff the values into an array and run array_filter on it
(removing 0 values). Then min/max on the array will give you the requested
result..
Martin
Jul 16 '05 #4

"Alexander Ross" <al******@bleen.net> wrote in message
news:YNRVa.19379\$uu5.1172@sccrnsc04...
If I have a series of integers, how do I get the minimum (or maximum) value NOT equaled to 0??
--
Alexander Ross
al******@bleen.net

Hope I've got this one right, but I'd put the numbers in to an array,
perform a sort and then do an array_pop and an array_shift to take the first
and elements from the array - If either number was a zero, I'd perform the
the same routines again as they take the last and first element from the
array hence eventually you would get the lowest and highest number.

I've not tested this idea though for negative numbers but hope it gives you
some direction.
Jul 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.