Reputation: 316
I have one problem in my project.
$value="Rs.1,195";
echo getfloat($value);
I need out is only
1195
Upvotes: 0
Views: 62
Reputation: 1226
$string = "Rs.1,195";
print preg_replace("/[^0-9]/","",$string);
Output = 1195
Upvotes: 3
Reputation: 165
$value="Rs.1,195";
$int = filter_var($value, FILTER_SANITIZE_NUMBER_INT);
Upvotes: 0