Jay Blanchard wrote:
[snip] Is it possible to request that a string CONTAINS another string...?
EG: $string = "1, 2, 3, 7, 8, 9"; if ($string CONTAINS "7") { // Do stuff } [/snip]
Almost any regex function would work here, for instance
$string = "1, 2, 3, 7, 8, 9"; if (preg_match("/7/", $string)){ //evaluates to true // Do stuff }
From php.net:
Tipp: Do not use preg_match() if you only want to check if one string is contained in another string. Use strpos() or strstr() instead as they will be faster.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php