sniperscope Posted July 29, 2010 Share Posted July 29, 2010 Hi i wrote a find and replace code but my code replace last value of array and skip the first, second.... values in the array. Please give me an idea because i stack with this code. Regards $KeyWord = explode("\n", $RowGetWords['KEYWORDS']); $Replace = explode("\n", $RowGetWords['ReplaceTo']); for($i=0; $i<count($KeyWord); $i++){ $pattern = $KeyWord[$i]; $replace = "<a href=\"" .$URL. "\" target=\"_blank\" >" .$Replace[$i]. "</a>"; $html = str_replace($pattern, $replace, $Row['MessageBody']); } Link to comment https://forums.phpfreaks.com/topic/209188-find-n-replace-doesnt-replace/ Share on other sites More sharing options...
sniperscope Posted July 29, 2010 Author Share Posted July 29, 2010 hey guys have any idea and clue. Link to comment https://forums.phpfreaks.com/topic/209188-find-n-replace-doesnt-replace/#findComment-1092493 Share on other sites More sharing options...
sniperscope Posted July 30, 2010 Author Share Posted July 30, 2010 Forget it. I figured out Link to comment https://forums.phpfreaks.com/topic/209188-find-n-replace-doesnt-replace/#findComment-1092998 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.