Is there a way to perform a regular expression search through an array without iterating and preg_match()ing?
The php.net doc for array_search says that "needle" can be a string, which sort of implies that it could be something else (which is supported by the "mixed" type next to it in the signature description). I tried using a regex, and it doesn't behave as desired.
Ideally, I'm looking for something like array_search that can take a regex. Otherwise I have to loop, which seems kind of inelegant.
Thanks.
regex search through array?
Moderator: General Moderators
-
tomprogers
- Forum Commoner
- Posts: 50
- Joined: Fri Mar 17, 2006 5:17 pm
- Location: Minnesota
- Contact:
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
-
tomprogers
- Forum Commoner
- Posts: 50
- Joined: Fri Mar 17, 2006 5:17 pm
- Location: Minnesota
- Contact: