Skip to content

Instantly share code, notes, and snippets.

@wallacemaxters
Last active August 28, 2015 12:10
Show Gist options
  • Save wallacemaxters/527997bfc1451bbb8732 to your computer and use it in GitHub Desktop.
Save wallacemaxters/527997bfc1451bbb8732 to your computer and use it in GitHub Desktop.
<?php
$numero = '0.12.13';
preg_replace('/\D+/', '', $numero); // string('01213')
preg_replace('~\D+~', '', $numero); // string('01213')
preg_replace('#\D+#', '', $numero); // string('01213')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment