Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa PHP WHAT IS THE FUNCTIONALITY OF THE FUNCTIONS STRSTR() AND STRISTR()?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


brijesh
WHAT IS THE FUNCTIONALITY OF THE FUNCTIONS STRSTR() AND STRISTR()?
1 Answer(s)      4 years ago
Posted in : PHP


WHAT IS THE FUNCTIONALITY OF THE FUNCTIONS STRSTR() AND STRISTR()?


Advertisement
View Answers

November 15, 2010 at 11:15 AM


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. stristr() function is also but it is case insensitive.

strstr() example

<?php
$username= 'deepak';
$substring_username = strstr($username, 'p');
echo $substring_username; // prints pak
?>

stristr() example

<?php
$username= 'DEEPAK';
$substring_username = stristr($username, 'p');
echo $substring_username;
// outputs PAK.

Thanks



Related Tutorials/Questions & Answers:
 

 

 

DMCA.com