Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    771

    Real quick/easy Q

    I have;
    if($bleh == "bleh") { }

    How do I make it;
    if($bleh == word that contains "bleh") { }



    This should be real easy.. I have just had a complete memory blank

  2. #2
    Join Date
    Sep 2002
    Location
    Dallas, TX
    Posts
    205
    This is PHP? Are you trying test whether $blah contains "blah"?

    if (strpos($blah, "blah")) {...
    justin 'at' abrogo.com
    http://www.abrogo.com
    Shared Unix Hosting

  3. #3
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    771
    Yup, worked - thanks a heap

  4. #4
    Join Date
    May 2002
    Location
    UK
    Posts
    2,994
    You can also use strstr() to work out if a string contains what you want

    http://www.php.net/manual/en/function.strstr.php

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •