Jump to content

[SOLVED] ereg_replace()


DrTrans

Recommended Posts

1) If you look in the manual:

This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged.

2) Patterns require delimiters (~, or any non-reserved keyword in regex.

3) You were missing a semi-colon after the $title declaration.

4) Instead of blacklisting, just explicitly put in apostraphy.

5) Use code tags.

6) I think you meant to say, "stripped" not "striped".

 

$title = "This Suck's";
$stripped =  preg_replace("~'~", " ", $title );
echo $stripped;

?>

Link to comment
https://forums.phpfreaks.com/topic/178076-solved-ereg_replace/#findComment-938946
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.