Jump to content

Preg Replace Help!


b00ker_b0y

Recommended Posts

You still need pattern delimeters in there...

 

<?php
$campaign = "ebook\'s";
$campaign = preg_replace('/\\/', '', $campaign);
?>

 

More importantly though, where did the slash come from?  In this instance where has ebook\'s come from?  As PHP has functions for dealing with slashes. e.g stripslashes()

 

Regards

Huggie

Link to comment
https://forums.phpfreaks.com/topic/71355-preg-replace-help/#findComment-359031
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.