What is the functionality of the function strstr and stristr?

Author Topic: What is the functionality of the function strstr and stristr?  (Read 734 times)

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 159
  • Karma: 0
    • Hot Shaper
strstr Returns part of string from the first occurrence of needle(sub string that we finding out ) to the end of string.

$email= 'sonialouder@gmail.com'; $domain = strstr($email, '@'); echo $domain; // prints @gmail.com here @ is the needle stristr is case-insensitive means able not able to diffrenciate between a and A


Offline TomClarke

  • Trade Count: (0)
  • Hero Member
  • *****
  • Thank You 50
  • Posts: 893
  • Karma: 0
  • Gender: Male
    • Custom Writing Service & Content Marketplace
    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
Your ideas, our writings - Writology.com

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
2989 Views
Last post 11-04-2011, 00:33:08
by mack0
4 Replies
4930 Views
Last post 03-26-2016, 03:14:26
by qx_1789
0 Replies
990 Views
Last post 05-26-2015, 22:52:51
by jaysh4922
0 Replies
1117 Views
Last post 12-19-2015, 02:55:07
by chinmay.sahoo
1 Replies
575 Views
Last post 04-19-2016, 03:56:12
by TomClarke