×
Home About Us Products Services News Free Scripts Contact
news php scripts and software

PHP example - How to remove symbols which are not digits from a string?


PHP - How to remove symbols which are not digits from a string?

In order to do this you may use the following regular expression:

<?php
....
 $strOutput = ereg_replace("[^[:digit:]]", "", $strInput); 
...
?>

In this case for example if Input is 43~34^67, the output will be:
433467

Category: PHP

 
<< Go back