Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-05-2007, 02:35 PM   #1
alex79
Confirmed User
 
Join Date: Jun 2002
Location: france
Posts: 996
php quick question

i'm trying to replace the character "?" with "-" from $string using

$result=eregi_replace("?","-",$string");

but the result is a null array..
what i'm doing wrong?

thanks
__________________
alex79 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2007, 02:40 PM   #2
DigitalPimp
Confirmed User
 
Industry Role:
Join Date: Jun 2003
Location: Los Angeles, CA
Posts: 512
don't need the last quote, also try str_replace instead

Last edited by DigitalPimp; 12-05-2007 at 02:41 PM..
DigitalPimp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2007, 02:42 PM   #3
alex79
Confirmed User
 
Join Date: Jun 2002
Location: france
Posts: 996
Quote:
Originally Posted by DigitalPimp View Post
don't need the last quote
yes.. without last quote.. but how do i "escape" the ? character?
__________________
alex79 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2007, 02:43 PM   #4
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
$result = str_replace("?", "-", $string);
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2007, 02:47 PM   #5
alex79
Confirmed User
 
Join Date: Jun 2002
Location: france
Posts: 996
Quote:
Originally Posted by Jaysin View Post
$result = str_replace("?", "-", $string);
this is working..thank you
__________________
alex79 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2007, 02:48 PM   #6
DigitalPimp
Confirmed User
 
Industry Role:
Join Date: Jun 2003
Location: Los Angeles, CA
Posts: 512
for future reference, you can escape characters with special meaning like a ? by putting a \ before them but when you use str_replace instead of eregi_replace it will not give special meaning to the ? so you don't need to escape it.
DigitalPimp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.