![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
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
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Jun 2002
Location: france
Posts: 996
|
yes.. without last quote.. but how do i "escape" the ? character?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
MOBILE PORN: IMOBILEPORN
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
|
$result = str_replace("?", "-", $string);
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Jun 2002
Location: france
Posts: 996
|
this is working..thank you
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
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.
|
![]() |
![]() ![]() ![]() ![]() ![]() |