![]() |
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 |
don't need the last quote, also try str_replace instead
|
Quote:
|
$result = str_replace("?", "-", $string);
|
Quote:
|
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.
|
All times are GMT -7. The time now is 11:33 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123