hi, I have this piece of code. but the problem is that he also links parts of words (like: credits) and i wnat only standalone words (like: edit) Does someone have i idea to correct this piece of code?
Floris ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- -------------- function link_search($search_words,$string,$id) { $word_no=0; foreach($search_words as $search_word) { $regex1 = ">[^<]*("; $regex2 = ")[^<]*<"; preg_match_all("/".$regex1.$search_word.$regex2."/i", $string, $matches, PREG_PATTERN_ORDER); foreach($matches[0] as $match) { preg_match("/$search_word/i", $match, $out); $case_sensitive_search_word = $out[0]; $chan = "<a href='woordenboek.php?id=$id&woord=$case_sensitive_search_word' target='_blank'>$case_sensitive_search_word</a>"; $newtext = str_replace($case_sensitive_search_word, $chan, $match); $string = str_replace($match, $newtext, $string); } $word_no++; } return $string; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php