On Mon, Mar 26, 2001 at 08:07:45PM -0800, Chad A. Adlawan wrote:
> hi!
> 
> i would like to search out all non-numeric characters in my string and replace
> them with nothing in PHP.
> i tried
> 
> preg_replace("[^0-9]","",$my_string);
use strtr in this case, for preg_replace, you should use '/[^0-9]/'

use strtr to replace some chars, regexps are a bit overkill for this
task

-- 
,-------------------------------------------.
> Name:           Alson van der Meulen      <
> Personal:       [EMAIL PROTECTED]       <
> School:       [EMAIL PROTECTED]    <
`-------------------------------------------'
Do you really need your home directory to do any work?
---------------------------------------------


--  
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to