+ 1
Php true/false values and conditions.
just a simple question: which values give true and which false... Know which in js...but this course can't give me answers even on half of my questuons :D how about Undefined,NaN,null... What will be result of comparing them... Type of this things.... Yeah..I google it up tomorrow anyway... But I guess you'll help others too :D Cause this is realy important thing...
5 Respostas
+ 1
True 1,False 0.Undefined NaN and NULL totally specific things if you control a variable if its NULL you should write var=='NULL'
0
Yeah...that's simple...but I was talkin' about other thing.
1.Which exectly values will give us 1 or 0.
As example in js : any values exept undefined,null , NaN , "",0 will output false if we'll convert values into boolean type.
How about php ?
And other part:
2.What about comparing NaN with NaN,
Undefined with Undefined
or null with null...
And null with NaN e.t.c.
That's realy important thing everyone should know as i think.
At least in js it's so.
3.What about types of NaN,Undefined,null ?
0
only 0 will give you 0 value other values except NaN undef or NULL will give you value 1 like 23000 will give you value 1
as for NaN or NULL controls as i said you control them like this:"var=='NaN'or'NULL'"
0
and they all have uniqe types
0
so...
0,undefined,NaN,null - 0 ;
Any others 1 ?
even empty string ?
About control : user can input "NaN" or "Undefined",so var==NaN\Undefined just will not work here,exept we'll use ===...
But even about it - not so sure,about how it works here.
more about control:
Is there way to control this special types for sure ?
and still:
What about comparing special types ?