Jump to content

preg_replace


robthemanbob

Recommended Posts

I am creating a XML RSS feed with php while pulling information from the dabase in a while $row loop I need to use a preg_replace to remove  a "&" from the database pull I have tried

 

 

utf8_encode($pagefile); 

$patterns[0] = ' & ';

$replacements[0] = '&';

str_replace($patterns, $replacements, $pagefile);

 

with no luck.

 

 

Any advice would be fantastic

Link to comment
https://forums.phpfreaks.com/topic/84331-preg_replace/
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.