Ask a Question related to PHP Development, Design and Development.
-
Tim Van Wassenhove #1
Re: preg_match_all total newbie
On 2004-01-08, Something <*****@*****.***> wrote:
Define "better"?> Just learning PHP (4.3.4). I seem to understand most. But one little
> problem I couldn't figure out:
> I need to be able to take a string (as 'Smith, Charly') and run it
> through some sort of filter that only lets through the letters so
> 'SmightCharly' is returned. I have tried my luck with some of the grep
> functions but am totally unsuccessful. If nothing else I could write a
> little function to do this but there's gotta be a better way.
Just remove all characters that are not in the interval [a-zA-Z].
str_replace will do just fine.
--
[url]http://home.mysth.be/~timvw[/url]
Tim Van Wassenhove Guest
-
Total newbie--please be patient
I've tried several flavors of Linux and finally settled on Ubuntu--received my CDs the other day. Trouble is, whenever I try to set up a dual boot... -
Total Newbie Needs Help
How is your database setup? -
Newbie - Sum the total
I am using Accss not SQL. ProductA sold 2 sets yesterday and 1 set today, Product B sold 3 sets yesterday and 2 sets today. By using "while not... -
Total newbie to this!
Hi, I'm trying to crop up an image for a forum and the crop option doesn't do it as I want it to so I tried cutting, pasting and moving the parts I... -
Total newbie: ASP.NET or Coldfusion ?
If you look at the difference in terms of power, ASP.Net is simply the most powerful web application platform ever to be created. It also is... -
Bryan Chan #2
Re: preg_match_all total newbie
To remove non-alphanumeric characters:
$sFiltered = eregi_replace("[^a-z0-9]", "", $sString);
Where $sString contains "Smith, Charly", the statement would return
$sFiltered contains "SmithCharly". [^...] implies character class "not"
containing specific characters.
Hope it helps. :-]
Bryan
"Something" <*****@*****.***> wrote in message
news:*****-1533D1.01534708012004@news.indiana.edu...> Just learning PHP (4.3.4). I seem to understand most. But one little
> problem I couldn't figure out:
> I need to be able to take a string (as 'Smith, Charly') and run it
> through some sort of filter that only lets through the letters so
> 'SmightCharly' is returned. I have tried my luck with some of the grep
> functions but am totally unsuccessful. If nothing else I could write a
> little function to do this but there's gotta be a better way.
>
> Any suggestions welcome.
>
> Peter
>
> --
> [url]www.acmerecords.com/oddgitjazz.html[/url]
Bryan Chan Guest



Reply With Quote

