gerkintrigg Posted June 2, 2006 Share Posted June 2, 2006 Hiya, could anyone tell me the best way to remove numbers from a text string please? I think it's using explode, but i don't remember the correct syntax and can't seem to find an example anywhere.The string is coming from a database (dunno if this makes a difference).thanks. Link to comment https://forums.phpfreaks.com/topic/11009-removing-numbers-from-a-string/ Share on other sites More sharing options...
samshel Posted June 2, 2006 Share Posted June 2, 2006 $string = "abc123abc";$new_str = preg_replace("/[0-9]+/i","",$string);echo $new_str; Link to comment https://forums.phpfreaks.com/topic/11009-removing-numbers-from-a-string/#findComment-41116 Share on other sites More sharing options...
gerkintrigg Posted June 2, 2006 Author Share Posted June 2, 2006 thanks very much ;-) Link to comment https://forums.phpfreaks.com/topic/11009-removing-numbers-from-a-string/#findComment-41149 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.