Hi guys, below are simple script for word replacement, it is replacing a word in to link $word = array( 'google', 'yahoo' ); $link = array( '<a href="http://google.com">google</a>', '<a href="http://yahoo.com">yahoo</a>' ); $this->post['message'] = str_ireplace($word, $link, $this->post['message']); PHP: please help guys, how to exclude the text google inside hyperlinks above from replaced, but the text google outside hyperlinks are still replaced maybe using if statement in the simple script above, or other way
thanks for answering, but i am afraid its get error and not working, any other code or other way please?
Yes, you are right, I just did a quick snap and it didn't work for me. I am sure, there has to be some workaround or maybe I am doing wrong. If you happen to not find till this weekend, I will do it, right now am at work... Weekends - Yes! I will work over it and am sure, it must a tiny thing missed