[thelist] PHP Doubling up
Andrew Maynes
andrew at humanbehaviour.co.uk
Wed Aug 14 09:20:12 CDT 2002
ok removed it to leave this and no joy, going to sound thick now but how do I
php Insert a print statement to print out your key/value pairs?
/* Lets get the total of products and the total cost */
function status($cart) {
if($cart) {
foreach ($cart as $item => $value) {
$number += $cart[$item][qty];
$total += ($cart[$item][qty] * $cart[$item][unit_price]);
}
$total = correct($total);
$return = "Your order contains <strong>".$number." </strong>";
$return .= "items costing a total of
<strong>£".$total."</strong>";
}
return($return);
}
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/02
More information about the thelist
mailing list