true
using PHP functions to $x compare variables
An expression |
GetType () |
empty () |
is_null () |
isset () |
boolean : if ($x) |
$x = ""; |
string |
true |
false |
true |
false |
$x = null; |
null |
true |
true |
false |
false |
var $x; |
null |
true |
true |
false |
false |
$x is undefined |
|
true | TD align= "left" >
false |
false |
$x = Array (); |
array |
true |
false |
true |
false |
$x = false; |
boolean |
true |
false |
true |
false |
$x = true; |
boolean |
false |
false |
true |
true |
$x = 1; |
integer |
false |
false |
true |
true |
$x =; |
integer |
false |
false |
true |
true |
$x = 0; |
integer |
true |
false |
true |
false |
$x =-1; |
integer |
false |
false |
true |
true |
$x = "1"; |
string |
false |
false |
true |
true |
$x = "0"; |
string |
true |
false |
true |
false |
$x = "1"; |
string |
false |
false |
true |
true |
$x = "php"; |
string |
false |
false |
true |
true |
$x = "true"; |
string |
false |
false |
true |
true |
$x = "false"; |
String |
FALSE |
FALSE |
TRUE |
TRUE |
The above is the usual development of the attention, there are questions you can verify the next Kazakhstan welcome
No matter what the industry, as long as you do two things good enough, one is your professional, one is your character, professional decision of your existence, personality determines your network, the rest is to insist, with good professional and sincere win more trust. Do not forget to beginner's mind party always!
PHP Variable Boolean validation