note 9789 added to strstr
| From: | arni at linux dot is | Date: | Thu, 23 Nov 2000 15:00:41 +0000 |
| Subject: | note 9789 added to strstr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8032@lists.php.net to get a copy of this message | ||
This functions is also widely used for checking if a string is in a string since it returns false if
the string was not found in container.
E.g.
<?
$string = "PHP";
$container = "I love writing PHP code.";
if(strstr($container,$string)) {
echo "found it.";
}
else {
echo "not found.";
}
?>
http://www.php.net/manual/function.strstr.php