@NogDogFeb 14.2005 — #[i]Originally posted by BeachSide [/i]
[B]you could always use a regex
[code=php] <?php $word = "cuff"; $sentence = "the gold cuff link shines"; if (preg_match('/\b' . $word . '\b/', $sentence)) { echo "success"; } else { echo "fail!"; } ?> [/code] [/B][/QUOTE] To make it case-insensitive: [code=php]if (preg_match('/\b' . $word . '\b/i', $sentence)) {[/code] Alternatively, if you prefer that "cuff" matches "the gold cuff link shines" and "police use handcuffs sometimes", you could just use: [code=php] # importatnt that you use !== and NOT != if(strpos(strtoupper($sentence), strtoupper($word)) !== FALSE) { # found it } else { # did not find it } [/code]