It is currently Sat Jun 22, 2013 10:07 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: PHP Questions
PostPosted: Tue Jul 12, 2011 6:53 am 
Offline
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
 Profile  
 
 Post subject: Re: PHP Questions
PostPosted: Wed Oct 12, 2011 5:15 am 
Offline
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
 Profile  
 
 Post subject: Re: PHP Questions
PostPosted: Tue Nov 29, 2011 7:41 am 
Offline
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
 Profile  
 
 Post subject: Re: PHP Questions
PostPosted: Sat Apr 21, 2012 6:07 pm 
Offline
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
 Profile  
 
 Post subject: Re: PHP Questions
PostPosted: Fri Sep 14, 2012 11:45 am 
Offline
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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


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

Jump to:  
Powered by Graphic Design Blog © 2019

phpBB SEO
[ Time : 0.142s | 8 Queries | GZIP : On ]