Organizational Research By

Surprising Reserch Topic

Difference between strstr and stristr in php?



asked Sep 13, 2013 in PHP by ashish singh
edited Sep 12, 2013
0 votes
33 views



Related Hot Questions

2 Answers

0 votes
stristr() - Find first occurrence of a string (Case-insensitive)
Syntax:
stristr ($string, string)  
 
Example:
$email = 'phptutorail@test.com';
$domain_name = stristr($email, 'E');
echo $domain_name; 
 
 
?>
Output: tutorail@est.com
answered Sep 13, 2013 by ashish singh
edited Sep 12, 2013
0 votes

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:


$email = 'phptutorial@test.com';
$domain_name = strstr($email, 't');
echo $domain_name; 


?>


Output:phptutorial.com

answered Sep 13, 2013 by ashish singh
edited Sep 12, 2013

...