robthemanbob Posted January 3, 2008 Share Posted January 3, 2008 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 Quote Link to comment Share on other sites More sharing options...
effigy Posted January 3, 2008 Share Posted January 3, 2008 It sounds like you need to use the proper tool for creating the XML. How is this being done--some code perhaps? Quote Link to comment Share on other sites More sharing options...
dsaba Posted January 6, 2008 Share Posted January 6, 2008 <?php #preg_replace echo preg_replace('~&~', '', 'hello w&orld'); #str_replace echo str_replace('&', '', 'hello w&orld'); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.