gerkintrigg Posted July 10, 2009 Share Posted July 10, 2009 Hi, I am trying to use str_replace() to remove a javascript reference from a text string (which comes from an XML Feed, but that's kinda irrelevant). I am using this code: $content=str_replace('<script type="text/javascript" language="javascript" src="http://feeds.directnews.co.uk/client_includes/bookmarking/bookmarks.js">Â </script>',' ', $r['Content']); It's not removing the code and all I can think of is that the markup within the tag might be causing interferance in some way. The website is: http://www.myointernational.com/news/scientists-claim-fish-'learn-like-humans' and has two bookmark scripts. I want to remove the first one. Quote Link to comment https://forums.phpfreaks.com/topic/165493-solved-code-in-string-queries/ Share on other sites More sharing options...
J.Daniels Posted July 10, 2009 Share Posted July 10, 2009 Try to echo out $r['Content'] to see if the string is in there and how it is displayed. Quote Link to comment https://forums.phpfreaks.com/topic/165493-solved-code-in-string-queries/#findComment-872842 Share on other sites More sharing options...
JonnoTheDev Posted July 10, 2009 Share Posted July 10, 2009 just use strip_tags() Quote Link to comment https://forums.phpfreaks.com/topic/165493-solved-code-in-string-queries/#findComment-872899 Share on other sites More sharing options...
gerkintrigg Posted July 11, 2009 Author Share Posted July 11, 2009 excellent, thanks Quote Link to comment https://forums.phpfreaks.com/topic/165493-solved-code-in-string-queries/#findComment-873416 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.