Author |
Message |
james1
|
Post subject: PHP Questions Posted: Tue Jul 12, 2011 6:53 am |
|
|
GDB Regular |
|
Joined: Tue Apr 12, 2011 6:09 am Posts: 97
|
What is the functionality of the function strstr and stristr?
_________________ web hosting
|
|
Top |
|
|
eswari
|
Post subject: Re: PHP Questions Posted: Wed Oct 12, 2011 5:15 am |
|
|
GDB Regular |
|
Joined: Mon Sep 12, 2011 12:23 pm Posts: 40
|
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
|
Post subject: Re: PHP Questions 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
|
Post subject: Re: PHP Questions Posted: Sat Apr 21, 2012 6:07 pm |
|
|
GDB Newbie |
|
Joined: Sat Apr 21, 2012 5:46 pm Posts: 8
|
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 |
|
|
|
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
|
|
|