Search This Blog

Wednesday, March 28, 2018

PHP: Remove all characters from a string except numerical digit


You can use following example for removing character leaving all the numerical digit

$nano_number=preg_replace('/[^0-9.]/', '', $nano_string);

No comments:

Post a Comment