kevinkorb Posted July 18, 2006 Share Posted July 18, 2006 $string = 'the rapist 4';I want to remove all non-alpha characters to produce$new_string = 'therapist';Thanks a bunch... I'm sure this is cake for most of you. Quote Link to comment Share on other sites More sharing options...
shoz Posted July 18, 2006 Share Posted July 18, 2006 [code]<?php$string = 'the rapist 4';$string = preg_replace('/[^a-zA-Z]/', '', $string);echo $string;?>[/code] Quote Link to comment Share on other sites More sharing options...
effigy Posted July 18, 2006 Share Posted July 18, 2006 Are you only working with ASCII? 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.