Hello,
I need help to create a function that search if more than one word is contained in a string.
Example:
$String = "girl...., this is my girl, She is beautiful."
And i need to search "girl she is" and replace only this text with <b>girl, she is</b>
I have make this:
$words = array("girl","she","is");
for ($i=0;$i<count($words);$i++){
$String = eregi_replace("([áéíóú[:alnum:]]+)$words$i","\1<b>$words[$i]</b>\2",$String);
}
But this function change all words thats apear in $String and i need only to change where all words are together
I like this:
$String: "girl...., this is my <b>girl, She is</b> beautiful."
Beeter this:
$String: "girl...., this is my <b>girl</b>, <b>She is</b> beautiful."