What is the difference between the functions strstr() and stristr()?
What is the difference between the functions strstr() and stristr()?
strstr() and stristr both are used to find the first occurrence of the string.
In PHP both functions are used to find the first occurrence of a substring in a string except
stristr() is case-insensitive and strstr is case-sensitive, if no match is found then FALSE will be returned.
Sample Usage:
<?php
$email = ‘abc@xyz.com’;
$hostname = strstr($email, ‘@’);
echo $hostname;
output: @xyz.com
?>
stristr() does the same thing in Case-insensitive manner.
affiliate marketing agency | affiliate marketing services | affiliate marketing company | email marketing agency | lead generation agency | social media marketing agency | cost per sale Advertising Agency | cost per installation agency | cost per acquisition agency |
Lead Generation Advertising Agency |
Email Marketing agency |
social Media Marketing agency
|
Bookmarks