Difference between strstr and stristr in php
Posted by Raj
Difference between strstr and stristr in php.
strstr() and stristr both are used to find the first occurence of the string but stristr( ) is case insensitive.strstr() - Find first occurrence of a string
Syntax:
strstr ($string, string)
Example:
<?php
$email = 'rajesh@tEst.com';
$domain_name = strstr($email, 'E');
echo $domain_name;
?>
Output:Est.com
stristr() - Find first occurrence of a string (Case-insensitive)
Syntax:
stristr ($string, string)
Example:
<?php
$email = 'rajesh@tEst.com';
$domain_name = stristr($email, 'E');
echo $domain_name;
?>
Output: esh@tEst.com
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
difference between strstr() and stristr(),
Interview Questions,
PHP,
PHP articles,
PHP discussions,
PHP interview,
PHP interview questions,
PHP interview questions and answers,
PHP Jobs
.You can leave a response, or trackback from your own site.