Reputation: 1125
I am working on one of the ecommerce project in OScommerce and I have to implement google tracking in it, Google doesn't allows product price with currency symbol as a parameter in it's method . but on my payment success page I got product price with the currency symbol. So, is there any way through which we extract numeric value from product price.
Upvotes: 1
Views: 204
Reputation: 19899
Try:
$price_no_curr = preg_replace ( '#\D*?(\d+(\.\d+)?)\D*#', '$1', $price);
Upvotes: 2