Deprecate currency symbol from product price
-
03-07-2021 - |
문제
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.
해결책
Try:
$price_no_curr = preg_replace ( '#\D*?(\d+(\.\d+)?)\D*#', '$1', $price);
제휴하지 않습니다 StackOverflow