Hi all, having a slight problem, I’m created an ordering system and looping through the products added to enter them into the database (working perfectly). Problem is, if someone accidentally enters a £ in the product total, it’s upsetting things. How can I remove the £ sign? Tried the following but no luck. Any help is appreciated as always
//Enter Products into DB
foreach($_POST['products'] as $id=>$product){
$blip = preg_replace('/^\\£/', '', $product['price']);
$total = $blip*$product['quantity'];
$total;
//Push Data into Database
$sql = "INSERT INTO order_products (receipt_id, customer_id, product_name, product_price, product_quant, product_serial, product_code, sub_total) VALUES ('$_POST[receiptno]','$_GET[id]','$product[name]','$blip','$product[quantity]','$product[serial]','$product[stock]','$total')";
mysql_query($sql);
}
$addDet = "INSERT INTO orders (addedby, receipt_id, date_added, del_method, courier, spec_instr, cust_ref, date_dispatched, delivery_costs, part_exchange, vat_info, three_month_warranty) VALUES ('$_SESSION[SESS_LOGIN]','$_POST[receiptno]',now(),'$_POST[delmethod]', '$_POST[courier]', '$_POST[specialinst]','$_GET[id]', '$_POST[dispatched]', '$_POST[postage]', '$_POST[pxvalue]', '$_POST[vatInfo]', '$_POST[warranty]')";
mysql_query($addDet);
}