Hi
I had a webpage (basket) that was working fine until a change was required and i need help with what i think is the root cause of the problem.
I was originally storing an integer (productid) to the value of $k below but this has since changes to a string and now the function will not operate correctly.
can someone be kind enough to change the code (which i think is the preg_match bit) to allow strings and not just values from 0 to 9?
foreach ($_POST as $k => $v){
if ($v == 0) {
$nid = strstr($k, '_');
$newid = substr($nid, 1);
unset($_SESSION["cart"][$newid]);
} else {
if (preg_match("/^quantity_([0-9]+)/",$k,$matches)) {
$_SESSION["cart"][$matches[1]]["quantity"] = $v;
}
}
}
Many Thanks