SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    $this->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Dec 2003
    Location
    Federal Way, Washington (USA)
    Posts
    1,524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What does the <> operator mean?

    I've seen that in several posts lately. I don't have that listed in my PHP book and can't seem to find it in my searching. If you have code like this:

    Code:
    if ($a <> "whatever") {
    //do something here
    }
    does it mean $a is equal to "whatever", not equal or what?
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    Showcase your music collection on the Web

  2. #2
    SitePoint Addict
    Join Date
    Nov 2004
    Location
    Canada
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it is if $var is NOT EQUAL to whatever..

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    Edmonton, the upper part of AB.
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what's wrong with != for not equal?

  4. #4
    $this->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Dec 2003
    Location
    Federal Way, Washington (USA)
    Posts
    1,524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by discotraxx
    what's wrong with != for not equal?
    Nothing wrong with it at all. In fact, that's what I normally use myself. I was just wondering about the other way of doing it.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    Showcase your music collection on the Web

  5. #5
    Romans 12:2 codyrockx's Avatar
    Join Date
    Jul 2003
    Location
    Newberg, Oregon
    Posts
    422
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The <> operator is more specifically for numeric expressions. As in meaning,
    PHP Code:
     if(<> 10
    If 5 is bigger than or less than 10 the statment returns true.
    Codyrobert.com - Designer and Developer

  6. #6
    SitePoint Evangelist
    Join Date
    Sep 2004
    Location
    Oregon
    Posts
    445
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hrm. I personally use

    !=
    == or =
    >
    <

    <> sounds confussing lol

  7. #7
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    It is confusing!
    But as with most coding languages there are many different ways of doing the same things but with subtle differences for different scenarios....
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  8. #8
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Comparison Operators

    Quote Originally Posted by medicjoe95
    Hrm. I personally use

    !=
    == or =
    >
    <

    <> sounds confussing lol
    = is an assignment operator. Also, don't forget the identical comparison operators

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  9. #9
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    I think it's just to confuse noobies and asp programmers!
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  10. #10

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by medicjoe95
    <> sounds confussing lol
    Quote Originally Posted by spikeZ
    It is confusing!
    But as with most coding languages there are many different ways of doing the same things but with subtle differences for different scenarios....
    Pascal for example only supports <> and doesnt know !=.

  11. #11
    SitePoint Evangelist
    Join Date
    Sep 2004
    Location
    Oregon
    Posts
    445
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by drzoid
    Pascal for example only supports <> and doesnt know !=.
    Pascal?

  12. #12

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by medicjoe95
    Pascal?
    http://en.wikipedia.org/wiki/Pascal_...mming_language


Bookmarks

Posting Permissions

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