Thread: Expressions

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    1
    Rep Power
    0
    I'm trying to get my PHP code to filter out fields that just have "http://" in them, but fields that have mor than "http://" such as "http://www.blah.com" should continue to be displayed. I've been trying to use the following code:

    if ($bizlogo_addy != "http://") {
    echo "<p><img src="" , $row["bizlogo_addy"] , "" border="1" align="top"></p>";
    }

    And it makes no difference. It'll still display fields with or without just "http://". If I change the != to ==, then it doesn't display anything. PLEASE HELP!

    Apunkah
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    I'm trying to get my PHP code to filter out fields that just have "http://" in them, but fields that have mor than "http://" such as "http://www.blah.com" should continue to be displayed. I've been trying to use the following code:


    see ..for this you can simply check the string length and proceed further.

    if(strlen($bizlogo_addy)==7){
    //only http://
    }else{
    // http://www.blah.com
    }

    this is very easy solution...

    Or

    you should use a regular expression match
    using ereg() function for fining out this.

    ------------------
    SR -
    shiju.dreamcenter.net

    "The fear of the LORD is the beginning of knowledge..."

    [This message has been edited by Shiju Rajan (edited June 13, 2000).]

Similar Threads

  1. regular expressions
    By tdennist in forum C Programming
    Replies: 2
    Last Post: January 18th, 2004, 06:01 AM
  2. regular expressions in Javascript
    By DazAdams in forum JavaScript Development
    Replies: 9
    Last Post: November 24th, 2003, 09:09 AM
  3. xml: How do I divide numbers in XSL expressions?
    By Wildman in forum Beginner Programming
    Replies: 2
    Last Post: June 30th, 2003, 02:28 AM
  4. Multiple IF expressions, one statement
    By basher in forum PHP Development
    Replies: 3
    Last Post: August 3rd, 2002, 01:28 PM
  5. Regular expressions tool
    By Harry in forum PHP Development
    Replies: 6
    Last Post: March 4th, 2002, 04:03 PM

IMN logo majestic logo threadwatch logo seochat tools logo