I agree, he is a bit on the edgy side... but he's also right.  This is
simple math.

Here, I'll write you a function:

function average ( $array_numbers ) {

    $total_numbers = count ( array_keys ( $array_numbers ) );

    $sum = array_sum ( $array_numbers );

    $average = $sum / $total_numbers;

    return $average;

}


$numbers = array ( 1 , 5 , 7 , 8 , 10 , 14 , 3 , 2 , 5 , 2 , 7 );

$average = average ( $numbers );

echo $average;

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit


> -----Original Message-----
> From: Todd Williamsen [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 28, 2001 11:44 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] Mathimatical equations in PHP
> 
> 
> BAT..
> 
> you need to get that stick out of your ass, you are annoying 
> and no help to
> people that needs it
> 
> "B.A.T. Svensson" <[EMAIL PROTECTED]> wrote in message
> 27E647E5629ED211BF78009027289C6302157DC5@mail1">news:27E647E5629ED211BF78009027289C6302157DC5@mail1...
> > Don't send CC message to those who does not need the information,
> > pleeeeeeeeeeeeeeeese!!!
> >
> > (I am starting to get pretty fucking annoyed about that 
> people doesn't
> check
> > those things before pressing the send button/key.)
> >
> > >-----Original Message-----
> > >From: Mike Flynn [mailto:[EMAIL PROTECTED]]
> > >Sent: Friday, December 28, 2001 5:32 PM
> > >To: Svensson, B.A.T. (HKG); [EMAIL PROTECTED]
> > >Subject: RE: [PHP-WIN] Mathimatical equations in PHP
> > >
> > >
> > >Huh?  To average?  You just use addition and division.  It
> > >doesn't require
> > >a function.  A function would not only be silly but 
> probably take more
> > >keystrokes just to type.
> > >
> > >Average = sum of units' values / number of units.
> > >
> > >Additionally, you can do this automatically if you're storing
> > >your values
> > >in a database such as MySQL, using built-in functions.  
> See the MySQL
> > >manual (www.mysql.com) or whatever database for more on this.
> > >
> > >-Mike
> > >
> > >At 05:11 PM 12/28/2001 +0100, Svensson, B.A.T. (HKG) wrote:
> > >>I am kind of pessimistic by nature, and would not with out
> > >having checked
> > >>out this thing believe the case is not in you favor this time.
> > >>
> > >>         /Anders
> > >>
> > >> >-----Original Message-----
> > >> >From: Todd Williamsen [mailto:[EMAIL PROTECTED]]
> > >> >Sent: Friday, December 28, 2001 5:04 PM
> > >> >To: [EMAIL PROTECTED]
> > >> >Subject: Re: [PHP-WIN] Mathimatical equations in PHP
> > >> >
> > >> >
> > >> >That is not what I was looking for, is there a function in PHP
> > >> >that does this?
> > >> >
> > >
> > >
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to