View unanswered posts | View active topics
|
Page 1 of 1
|
[ 5 posts ] |
|
Author |
Message |
james1
|
Posted: Tue Jul 12, 2011 6:53 am |
|
|
GDB Regular |
|
Joined: Tue Apr 12, 2011 6:09 am Posts: 84
|
What is the functionality of the function strstr and stristr?
_________________ web hosting
|
|
Top |
|
|
eswari
|
Posted: Wed Oct 12, 2011 5:15 am |
|
|
GDB Regular |
|
Joined: Mon Sep 12, 2011 12:23 pm Posts: 32
|
With strstr you can find a certain letter, number, or symbol in a string. A basic function could be to figure out if an email address is valid or not.
The stristr function is just a Case-Insensitive version of strstr.
_________________ Outsource Web Design | Joomla Outsource
|
|
Top |
|
|
kristy85
|
Posted: Tue Nov 29, 2011 7:41 am |
|
|
GDB Newbie |
|
Joined: Mon Nov 14, 2011 6:42 am Posts: 3
|
What is PHP? And where are you use? and why are you use? so please explain and give me advise about php because i want to learn php...
_________________ web development services
|
|
Top |
|
|
offline7890
|
Posted: Sat Apr 21, 2012 6:07 pm |
|
|
GDB Newbie |
|
Joined: Sat Apr 21, 2012 5:46 pm Posts: 7
|
With strstr you can find a certain letter, number, or symbol in a string. A basic function could be to figure out if an email address is valid or not.
<?php $email = "email@email.com"; $domain = strstr($email,"@"); $dot = strstr($domain,".");
if ($domain == "" && $dot == "") { do something } else { do something else } ?>
The strstr in $domain is looking for "@" in $email and the strstr in $dot is looking for a "." in $domain. The if means if $domain and $dot equal nothing(it would show up as blank because there is no "@" in $email so the strstr in $domain returns false and that would in turn return the strstr in $dot as false also), do something. then the else is if $domain and $dot equal something besides "" do something else.
The stristr function is just a Case-Insensitive version of strstr.
_________________ Decoration Ideas World | Samsung Galaxy Note
|
|
Top |
|
|
billsmith1097
|
Posted: Fri Sep 14, 2012 11:45 am |
|
|
GDB Junior |
|
Joined: Fri Sep 14, 2012 11:32 am Posts: 10
|
Both the functions are used to find the first occurrence of a string. Parameters includes: input String, string whose occurrence needs to be found, TRUE or FALSE (If TRUE, the functions return the string before the first occurrence.
_________________ Get Responsive Web Design | Best Lettering Design Software
|
|
Top |
|
|
|
Page 1 of 1
|
[ 5 posts ] |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum
|
|
|