frustrated Posted April 21, 2006 Share Posted April 21, 2006 Is there an easy way to strip a string of all non-alphebetical characters and numbers? Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted April 21, 2006 Share Posted April 21, 2006 yes but I am not sure how to put all of those pieces together. I can tell you that there is a whole chunk of functions for doing that type of thing in different ways, there are those that if utilized properly you can probably achieve that. Quote Link to comment Share on other sites More sharing options...
jworisek Posted April 21, 2006 Share Posted April 21, 2006 try something like this:[code]$string="aslj234u0jlkj3l4k+-043%";$replace = preg_replace('/[\d]*[^\w]*/','',$string);// the [\d] will remove all numbers// the [^\w] will remove all non a-zA-Z0-9_[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.