mardi 24 mai 2016

Why $var always return true?

I just know if(var) is only work in condition true or 1 till now. But when I put something like variable string and other numbers like 12332 is also work .Is mean if(var)work in variable is true or number or string ?

<?php
  $Check  = "sosdjf";  echo : true
//$Check  = 12332;     echo : true
//$Check  = false;     echo : false
if($Check){
    echo "true";
}
else{
    echo "false";
}

Aucun commentaire:

Enregistrer un commentaire