Created
August 17, 2015 04:27
-
-
Save kruxor/ad8e394ebf037e64b9e1 to your computer and use it in GitHub Desktop.
Only include 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
<?php | |
$str = "123fghy567"; | |
$str = preg_replace('/\D/', '', $str); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment