Jump to content

Can't get rid of "\f" string


bulrush

Recommended Posts

I've tried several variations of preg_replace to get rid of this string: "\f". But nothing seems to remove it. What am I doing wrong? Here is what I've tried.

$partname=preg_replace('/\f/', '', $partname); 
$partname=preg_replace('/\\f/', '', $partname); 

This works fine in Perl, but not in PHP. In Perl you simply escape the backslash with another backslash.

 

Link to comment
https://forums.phpfreaks.com/topic/210347-cant-get-rid-of-f-string/
Share on other sites

str_replace not working either. I tried:

$partname = str_replace("\f", "", "$partname");

$partname = str_replace("\f", "", $partname); //No quotes around $partname

 

All my other preg_replaces work, but I don't use backslash in any of them. It appears preg_replace and str_replace choke on a backslash.

 

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.