Professional Web Applications Themes

min and max functions - PHP Development

If I have a series of integers, how do I get the minimum (or maximum) value NOT equaled to 0?? -- Alexander Ross [email]alexrossbleen.net[/email]...

Sponsored Links
  1. #1

    Default 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
    [email]alexrossbleen.net[/email]


    Sponsored Links
    Alexander Ross Guest

  2. #2

    Default Re: min and max functions

    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 - [email]spamkoivi.com[/email]
    PHP POSTERS: Please use comp.lang.php for PHP related questions,
    alt.php* groups are not recommended.

    Justin Koivisto Guest

  3. #3

    Default Re: min and max functions

    other ... 3 variables with integer values

    "Justin Koivisto" <spamkoivi.com> wrote in message
    news:yVRVa.664$m3.33360news7.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 - [email]spamkoivi.com[/email]
    > PHP POSTERS: Please use comp.lang.php for PHP related questions,
    > alt.php* groups are not recommended.
    >

    Alexander Ross Guest

  4. #4

    Default Re: min and max functions

    > 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


    Martin C. Petersen Guest

  5. #5

    Default Re: min and max functions


    "Alexander Ross" <alexrossbleen.net> wrote in message
    news:YNRVa.19379$uu5.1172sccrnsc04...
    > If I have a series of integers, how do I get the minimum (or maximum)
    value
    > NOT equaled to 0??
    > --
    > Alexander Ross
    > [email]alexrossbleen.net[/email]
    >
    >
    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.


    Randell D. Guest

Similar Threads

  1. Too many functions!!!
    By mikeDoh in forum Macromedia Flash Flashcom
    Replies: 5
    Last Post: August 2nd, 05:10 PM
  2. web functions?
    By aaron in forum PHP Development
    Replies: 4
    Last Post: May 21st, 07:54 PM
  3. Using ZIP functions..
    By timmeh in forum PHP Development
    Replies: 2
    Last Post: October 27th, 09:23 PM
  4. #10743 [Com]: class functions & PHP core functions inconsistently clash ;)
    By destes at ix dot netcom dot com in forum PHP Development
    Replies: 0
    Last Post: August 11th, 09:21 PM
  5. Functions
    By Nice Chap in forum Microsoft SQL / MS SQL Server
    Replies: 1
    Last Post: July 4th, 12:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139