if(exclamation mark){

danielneridanielneri WP V.I.P.VPS - Virtual Prince of the Server
if you have this code:

[PHP]
if($sql){
echo "hi";
}[/PHP]

compared to this:

[PHP]if(!$sql){
echo "hi";
}[/PHP]

difference being putting an exclamation before the variable that has to be if-ed (if you know what i mean)...if-ecuted

what does that do? adding an exclamation mark?

always wondered about it...
ban1.gif

Comments

  • PythonPython Forum Leader The Royal RAM
    Basically what that does is the opposite of equals to... Heres an example...

    Normal version...
    [PHP]if($name = "bob)
    {
    echo "name is bob";
    }[/PHP]

    [PHP]if($name != "bob)
    {
    echo "name is not bob";
    }[/PHP]

    Where you had this:

    [PHP]if($sql){
    echo "hi";
    } [/PHP]

    That means that if $sql is set then it will display hi... But put an exclamation mark in front of it then it means that if $sql is NOT set then display hi

    The Royal Ram

  • danielneridanielneri WP V.I.P. VPS - Virtual Prince of the Server
    ah thanks soo much python ive been confused about that for a reaLLY long time

    :)
    ban1.gif
  • PythonPython Forum Leader The Royal RAM
    no problem :)

    The Royal Ram

Sign In or Register to comment.