|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-04-16 19:03 UTC] levim@php.net
-Status: Open
+Status: Feedback
-Package: Feature/Change Request
+Package: *General Issues
[2014-04-16 19:04 UTC] levim@php.net
[2014-12-30 10:41 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 17:00:02 2025 UTC |
Description: ------------ I think strpos would be greatly improved if the needle could be an array - much like preg_match, but without needing the complication of regex. The only way around this atm is a foreach loop. Reproduce code: --------------- Code 1 - currently foreach(array('searchterm1', 'searchterm2') as $needle) if(strpos($haystack, $needle) !== FALSE) return strpos($haystack, $needle); Code 2 - why isn't this allowed? strpos($haystack, array('searchterm1', 'searchterm2'))