RE: [PHP] IF statement question...

From: Date: Wed, 19 May 2004 12:10:36 +0000
Subject: RE: [PHP] IF statement question...
Groups: php.general 
Request: Send a blank email to php-general+get-186524@lists.php.net to get a copy of this message
[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 }

« previous php.general (#186524) next »