note 94095 deleted from function.in-array by bjori
| From: | bjori@php.net | Date: | Fri, 01 Jan 2010 17:34:26 +0000 |
| Subject: | note 94095 deleted from function.in-array by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-164519@lists.php.net to get a copy of this message | ||
Note Submitter: Will Reiher
----
I know this will probably be very slow over large datasets but I think I have a fairly simple way of
checking whether or not a string is in a simple array.
It's both case-insensitive and works like a "LIKE" function:
<?php
$bool = stristr(implode(' ', $array), $word);
?>
The "space" as glue is unnecessary but it's doesn't matter either way.