28, May 2012

Removing Unwanted Characters Using ereg_replace - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Removing Unwanted Characters Using ereg_replace
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: Removing Unwanted Characters Using ereg_replace  (Read 1573 times)
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« on: Mar 12, 2007, 03:02:18 am »

Please tell me how i can remove a series of characters using ereg_replace.

So far, i've been successful in removing one character only using this:

$string = ereg_replace('\"', '', $string);

What should i add so i could remove all characters and just retain the letters and numbers only?

thnks!
« Last Edit: Mar 12, 2007, 03:05:17 am by vbignacio »


Last blog : Bingag Beach, Bohol, Philippines
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #1 on: Mar 12, 2007, 04:11:34 am »

got it already:

$string = ereg_replace("[^a-zA-Z0-9\s ]", '', $string);


Last blog : Bingag Beach, Bohol, Philippines
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #2 on: Mar 12, 2007, 08:03:59 am »

Good.

Looks like you have started to learn man Smiley

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #3 on: Mar 13, 2007, 07:15:57 am »

you know me, always giving myself problems to solve.


Last blog : Bingag Beach, Bohol, Philippines
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #4 on: Mar 13, 2007, 11:59:31 am »

you know me, always giving myself problems to solve.

That's the attitude I like Smiley

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6207
Tags : php code Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: Removing Unwanted Characters Using ereg_replace
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 06:50:55 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.