note 24474 deleted from function.strpos by maxim

From: Date: Sat, 17 Aug 2002 22:43:22 +0000
Subject: note 24474 deleted from function.strpos by maxim
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-35181@lists.php.net to get a copy of this message
Just spent ages trying to get strpos to work and return true if _ was in a string - I've given up and am now using this simpler code: if (preg_match('/_/', $string)) //underscore found I don't think it will be slower by much a it's a fixed string of one character.

« previous php.notes (#35181) next »