Tags
PHP
Asked 6 years ago
2 Oct 2018
Views 914
sandip

sandip posted

money format to integer or float value in php

$a="14,137.84"

want to convert it
14137.84

how to convert to integer or float value from money format

suppose i do intval($a) it give 14 which is wrong
Rasi

Rasi
answered Nov 30 '-1 00:00

$int = preg_replace("/([^0-9\\.])/i", "", $a);

Post Answer