$string = "$4.9/inch";
$res = filter_var($string, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
echo $res;

It will print
4.9

Author: admin

Recent Posts

Categories

Tags

Leave a Reply

Your email address will not be published. Required fields are marked *