forzatio Posted July 7, 2007 Share Posted July 7, 2007 Hi there I'm trying to replace all from some RSS descriptions. example: great thing I actually need to replace two things, the first thing in the array does get replaced the second not. $search=array('width="120" height="90"',' '); $replace=array('width="280" height="210"','test'); $description = str_replace($search,$replace,$item[description]); What's bugging there ? thank you Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted July 7, 2007 Share Posted July 7, 2007 I just tested your code like this, and it worked fine: <?php $description = ' width="120" height="90"'; $search = array('width="120" height="90"',' '); $replace = array('width="280" height="210"','test'); $description = str_replace($search,$replace,$description); echo $description; ?> Output test width="280" height="210" Try changing this: $item[description] To: $item['description'] Quote Link to comment Share on other sites More sharing options...
forzatio Posted July 7, 2007 Author Share Posted July 7, 2007 Output test width="280" height="210" Try changing this: $item[description] To: $item['description'] Hi I tried that but I still get the same text like: great thing Maybe I should use some wildcards for those text items ? I'm not quiet sure if and how to use wildcards for this. Quote Link to comment Share on other sites More sharing options...
forzatio Posted July 8, 2007 Author Share Posted July 8, 2007 ok just doesn't work but does work 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.