Tuesday, December 1, 2009

What is the functionality of STRSTR() and STRISTR()

STRSTR find first occurance of a string.

string strstr ( string haystack, string needle )

string strstr ( string haystack, string needle ) returns part of haystack string from the first
occurrence of needle to the end of haystack

$email = 'programmerinphp@gmail.com';
$domain = strstr($email, '@');
echo $domain; // prints @gmail.com
?>

This function is case-sensitive

STRISTR is same as STRSTR but it is case insensitive

No comments:

Post a Comment

I just got my #domain @BigRock. Get upto 25% off with my personalized coupon link Get upto 25% off