note 76522 deleted from function.stripos by danbrown

From: Date: Wed, 29 Jun 2011 18:50:19 +0000
Subject: note 76522 deleted from function.stripos by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-181063@lists.php.net to get a copy of this message
Note Submitter: hpavon at gmail dot com ---- To shane_at_51smith-dot-nl Fine but not useful if you want to use stripos 3rd param òffset´ for instance to find all occurences of `needle´. Again rchillet and heavyraptor solution is best though you'd better keep to-lowercase strings outside the function if you're planning to loop through `haystack´ like this: $lower_haystack = strtolower($haystack); $lower_needle = strtolower($needle); $offset = 0; //... looping over haystack while ($offset !== false) { $offset = strpos($lower_haystack, $lower_needle, $offset); //... some funny stuff here } Using rchillet-heavyraptor function here would slow down performance. Solution: don't invent any function

« previous php.notes (#181063) next »