Seo Forum

Coding & Programming => Programming Forum => Topic started by: chinmay.sahoo on 05-02-2016, 05:59:49

Title: What is the functionality of the function strstr and stristr?
Post by: chinmay.sahoo on 05-02-2016, 05:59:49
strstr Returns part of string from the first occurrence of needle(sub string that we finding out ) to the end of string.

$email= 'sonialouder@gmail.com'; $domain = strstr($email, '@'); echo $domain; // prints @gmail.com here @ is the needle stristr is case-insensitive means able not able to diffrenciate between a and A
Title: Re: What is the functionality of the function strstr and stristr?
Post by: TomClarke on 05-11-2016, 01:05:43
    strstr() function is used to return the sub string from
first occurrence of string point from the string base.If
string point is not found, returns FALSE. syntax: strstr
(string base,string point)
examle: <?php
$email = 'arvindpippal@gmail.com';
$domain = strstr($email, '@');
echo $domain;
?>
output: @gmail.com
stristr() does the same thing in Case-insensitive manner