note 24474 added to function.strpos
| From: | gregNOSPAMrobson at postmasterNOSPAM dot co dot uk | Date: | Sat, 17 Aug 2002 12:42:19 +0000 |
| Subject: | note 24474 added to function.strpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-35168@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.
--
http://www.php.net/manual/en/function.strpos.php
http://master.php.net/manage/user-notes.php?action=edit+24474
http://master.php.net/manage/user-notes.php?action=delete+24474
http://master.php.net/manage/user-notes.php?action=reject+24474