Re: help with adding
| From: | Jochem Maas | Date: | Fri, 25 Feb 2005 19:48:13 +0000 |
| Subject: | Re: help with adding | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-209406@lists.php.net to get a copy of this message | ||
Jay Fitzgerald wrote:
I have messed with this for a couple of days and cant get it right. Maybe I need sleep :-) The code below is echoing the qty correctly (10, 5, 25) for ($i = 1; $i <= $sendnum; $i++) {$sum = 0 // init the var for ($i = 1; $i <= $sendnum; $i++) {$qty = $_POST['qty'.$i];echo $qty . '<br />';} The question is, how would I take add each of these numbers (10+5+25)?
$sum =+ intval($_POST['qty'.$i]);} echo "$sum<br />";
Any help is appreciated.