Forum : What is the functionality of the functions STRSTR() and STRISTR()?
Brief description  about Online courses   join in Online courses
View Balu  Prasad 's Profile

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

STRSTR() and STRISTR() functiuonalities....
Asked by Balu Prasad | Nov 9, 2009 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Balu,

strstr-finds the first occurence of a string inside another
string (case-sensitive)
stristr-finds the first occurence of a string inside
another string (case-insensitive)

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
Nov 9, 2009