note 84359 deleted from function.explode by felipe
| From: | felipe@php.net | Date: | Thu, 10 Jul 2008 18:09:15 +0000 |
| Subject: | note 84359 deleted from function.explode by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-141383@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
You can also use explode to find a word in a string (see strpos for best practice):
<?php
function in_string($needle, $haystack) {
$x = explode($needle, $haystack);
return ($haystack !== $x[0]);
}
?>