note 53489 deleted from function.array-search by felipe
| From: | felipe@php.net | Date: | Sun, 10 Feb 2008 13:09:46 +0000 |
| Subject: | note 53489 deleted from function.array-search by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-135951@lists.php.net to get a copy of this message | ||
Note Submitter: "info" at jake the spud dot com
----
If you don't need the power of recursive functions, and you want to just search within an array
for the existence of a string pattern, you can always try this:
if( strpos( implode( "", $array2search), "pattern" ) > -1 )
{
// code to execute here
}
It's kind of lame and childish, but gets the job done in a pinch.
Forgive me if someone else suggested this previously. I was racking my brain trying to do this using
array_search(), in_array() and the like, and all I wanted was something dead simple.