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? Link to comment https://forums.phpfreaks.com/topic/8061-quick-question/ 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. Link to comment https://forums.phpfreaks.com/topic/8061-quick-question/#findComment-29396 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] Link to comment https://forums.phpfreaks.com/topic/8061-quick-question/#findComment-29402 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.