Php search string without allowing substrings
<p>I want to search this string:
"This is, mybigstring"</p>

<p>And search words could be:
"is, big, mybigstring"</p>

<p>At the moment I'm using stristr which will find matches for all these words. However I do not want "big" to match.. Meaning that I won't allow substrings. How can I do this?</p>

<p>Update:
I tried this out after reading your answers:</p>

<pre><code>$testregxp = "\b(copenhagen|kobenhavn)\b";
$test = "Copenhagen, Denmark";
print preg_match($testregxp, strtolower($test));
</code></pre>

<p>But I can't seem to get it working..</p>
