SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: isset question

  1. #1
    Your daddy. WALoeIII's Avatar
    Join Date
    Apr 2001
    Location
    USA
    Posts
    526
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do I check if multiple things are set, I am gettting really frustrated.

    if (isset($var1 and $var2 and $var3)) {
    do something cool
    } else {
    don't do something cool
    }

    do I use and? or commas or what.

  2. #2
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try:

    if((isset($var1)) && (isset($var2)) && (isset($var3))) {
    blah

    Basically 'and' is replaced with '&&'

  3. #3
    SitePoint Member zap's Avatar
    Join Date
    Apr 2001
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you can only do this on that way:

    if (isset($var1) and isset($var2) and isset($var3)) {
    do something cool
    } else {
    don't do something cool
    }

    But that's my first post here so anyone can correct me

    Edit:

    Ohhh I'm to slow for this Board
    Last edited by zap; May 3, 2001 at 11:41.
    A German boy who wants to improve his PHP/MySQL knowledge in this Forum


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
  •