So would I just put this?

foreach(%_POST['number'] as $num)
{
    $output *= $num;
}
echo $output;

That's for multiplication.


----- Original Message -----
From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 8:24 AM
Subject: Re: [PHP] Looping Addition


> > One more question... If I then wanted to do this for the other
operations
> > (such as multiplication, division, etc), how would I do that?
>
> Assuming you've figured out how to do an array...
>
> You'll have to loop through the values like in the code that others
posted.
>
> foreach($_POST['number'] as $num)
> { //calculate total here with $num }
>
> * = multiplication
> / = divide
>
> ---John Holmes...
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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

Reply via email to