22, August 2008

Removing Unwanted Characters Using ereg_replace - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ 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

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


Philippine Beaches


« on: Mar 12, 2007, 04: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, 04:05:17 AM by vbignacio »


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


Philippine Beaches


« Reply #1 on: Mar 12, 2007, 05:11:34 AM »

got it already:

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


Last blog : Punta Engano Beach, Cebu, Philippines
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8020
41077 credits
Members referred : 3



« Reply #2 on: Mar 12, 2007, 09:03:59 AM »

Good.

Looks like you have started to learn man Smiley

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Pinoy Webmaster
.com pimp
*****
Gender: Male
Posts: 1126
6048 credits
Members referred : 0


Philippine Beaches


« Reply #3 on: Mar 13, 2007, 08:15:57 AM »

you know me, always giving myself problems to solve.


Last blog : Punta Engano Beach, Cebu, Philippines
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8020
41077 credits
Members referred : 3



« Reply #4 on: Mar 13, 2007, 12:59:31 PM »

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 Visit through proxy

Last blog : MIA - Where Nick and Tim
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....

Topic sponsors:
Get a permanent link here for $1.99!


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?
Aug 22, 2008, 03:38:08 AM





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!


Forum Statistics
Total Posts: 36.084
Total Topics: 7.439
Total Members: 3.807
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: marthawelch

32 Guests, 3 Users online :

16 users online today:



Readers

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