Created
January 10, 2015 19:57
-
-
Save matesnippets/9b4db275f9cb2e644a05 to your computer and use it in GitHub Desktop.
PHP, Keep numbers in a string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$str = preg_replace('/[^0-9.]+/', '', $str); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment