if not statement

Discussion in 'PHP' started by dcole07, Jul 29, 2006.

  1. #1
    is this an if not statement:

    if!()
    {
    }

    if not how do you do it? I'm trying to make a folder if the folder doesn't exist.
     
    dcole07, Jul 29, 2006 IP
  2. decepti0n

    decepti0n Peon

    Messages:
    519
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    if (!isset($var)) { }
    
    or
    
    if (empty($var)) {}
    
    or
    
    if (!something) {}
    Code (markup):
    or so :)
     
    decepti0n, Jul 29, 2006 IP
  3. coderlinks

    coderlinks Peon

    Messages:
    282
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Try this:
    
    if(!file_exists("foobar"))
    {
            mkdir("foobar");
    }
    
    PHP:
    Thomas
     
    coderlinks, Jul 29, 2006 IP
  4. dckoo5

    dckoo5 Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Just move the ! inside the parentheses.
     
    dckoo5, Jul 30, 2006 IP
  5. Radovan_III

    Radovan_III Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    yes ! shuld be infront and in parentheses. like


    if(!$var)

    {

    do something

    }
     
    Radovan_III, Jul 30, 2006 IP