Last visit was: Wed Apr 25, 2012 3:14 pm It is currently Wed Apr 25, 2012 3:14 pm

All times are UTC




 [ 4 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: 97
What is the functionality of the function strstr and stristr?

_________________
web hosting


Top
  
 
 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: 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
  
 
 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
  
 
 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: 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
  
 
 [ 4 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