Mortier Posted April 30, 2006 Share Posted April 30, 2006 HelloThe topic title says it already, is there an way I can strip off all the numeric charcaters?I can't find it.So that : 'blabla78';would become : 'blabla';Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/8753-strip-all-the-numeric-characters-from-a-variabele/ Share on other sites More sharing options...
OOP Posted April 30, 2006 Share Posted April 30, 2006 I think it is better to user regular expression to prevent using any number from the very beginning instead of allowing numric value then filtering it.thanks Link to comment https://forums.phpfreaks.com/topic/8753-strip-all-the-numeric-characters-from-a-variabele/#findComment-32150 Share on other sites More sharing options...
Barand Posted May 1, 2006 Share Posted May 1, 2006 try[code]$str = 'blabla78';$str = str_replace(range(0,9), '', $str);echo $str;[/code] Link to comment https://forums.phpfreaks.com/topic/8753-strip-all-the-numeric-characters-from-a-variabele/#findComment-32328 Share on other sites More sharing options...
Mortier Posted May 1, 2006 Author Share Posted May 1, 2006 Thanks, it works! Link to comment https://forums.phpfreaks.com/topic/8753-strip-all-the-numeric-characters-from-a-variabele/#findComment-32344 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.