hello, i need to replace some words in file with [tag]word[/tag] and other words with [sample]word[/sample].
i have a list of words which i need to replace with [sample] tags declared like $words = 'word1|word2|word3|word4'; replacing those words is easy i just use preg_replace('/\b( ' . $words . ')\b/i', '[sample]$1[/sample]', $file); but how to replace all other words that are not in $words array with [tag] tag ? thx in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php