What kinds of phrases are you looking for? If you want to know whether an *exact* phrase is going to appear in a block of text, just use strstr() or strpos(), they tend to be faster than regexes anyway.

http://www.php.net/strpos

function valid_phrase ($phrase, $search = 'text to search for') {
    return strpos($phrase, $search);
}

If you really want to use ereg though, you'll need to search for whitespace characters (or maybe just spaces, depending on your need). But I think strpos() will be fine for what you want to do.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to