Re: PREG_MATCH and arrays



..oO(Rik Wasmus)

On Wed, 02 Jan 2008 23:00:05 +0100, Michael Fesser <netizen@xxxxxx> wrote:

$keywords = implode('|', $filter_title);

foreach ($filter_test as $title) {
if (preg_match("/\b$keywords\b/i", $title)) {
// match
} else {
// no match
}
}

Or something like that.

One could do that, I'd advise top use a preg_quote() on the values though.

Good point.

Micha
.