...

View Full Version : Help! Getting just letters



bfinke
09-12-2009, 09:28 PM
I've been going crazy over this for hours. If I am given a string such as this:

$variable = "45$^nAm5e#";

How can I go about pulling ONLY the letters from that variable? In other words, is there a way to make it like this:

$variable = "nAme";


??

Thanks for any help!

seco
09-12-2009, 10:48 PM
echo preg_replace("/[^a-zA-Z\s]/", "", $variable);



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum