Difference between strstr() and stristr() functions in PHP.

By | August 2, 2011

Both functions are used to return or finds the first occurence of a substring from a string, and give all string from first occurence to end of string except than stristr() is case-insensitive.
If no match is found then FALSE will be returned.
Example

 
$email = 'abc@xyz.com';
 
$host = strstr($email, '@');
 
echo $host;
 
output: @xyz.com

stristr() does the same thing in Case-insensitive manner

2 thoughts on “Difference between strstr() and stristr() functions in PHP.

  1. tutorials

    Very nice post. I just stumbled upon your blog and wanted to say that I
    have truly enjoyed browsing your blog posts. In any case I will be subscribing to your rss feed and I hope you write again soon!

  2. Fundacja Helios

    Greetings! I’ve been following your web site for a
    long time now and finally got the bravery to go ahead and give you a shout out from Lubbock Texas!
    Just wanted to tell you keep up the good work!

Leave a Reply