FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Sub string? how to do?





darence
Hi. I need a php function which returns true if string1 is in string2, else return false. How to do this in php? Sorry, I am beginner Laughing
rheanna
http://www.phpbuddy.com/article.php?id=18

Quote:

If (conditions)
{
// Code if condition is true
}
else
{
// Code if condition is false
}


can't figure out where to find a comparision though. Good Luck ;o)
MrBlueSky
Code:


  if (strstr($string2, $string1)) {
    // Yep, $string1 is in $string 2
  } else {
   // Nope
  }

darence
Thanks, I will try.
Related topics
[php scripts ] phpweather&email
Tutorial: Image Rollovers w/ Javascript
vBasic
Classic Music, Do you like it?
Sub domains and add-on domains
Concerning Account Modifications; Sub-Domain Changes
writing COM components in Perl
Sub-Domains
Give each user a sub directory?
Programming in a lot of languages
Sub domain
Pixels
C++ Assignment! its about string.h
a regex help
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.