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
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