> I need to check that the substring " R" (that's a space followed by an
> uppercase R) is not contained within my haystack.

Just one way to do it:

$strings[] = 'Blah Blah R 99.99';
$strings[] = 'Blah Blah R99.99';
$strings[] = 'Blah Blah 99.99CR';
foreach($strings as $value) {

if (preg_match('/\sR/', $value)) {
   echo 'A match was found in '.$value.'<br />';
} else {
   echo 'A match was not found '.$value.'<br />';
}
}

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

Reply via email to