Tandem Posted September 26, 2006 Share Posted September 26, 2006 if i set a variable to false like this:[code]$blah = false;[/code]Does that effectively 'empty' the variable? Or does it literraly make it "false"? Or something else? Quote Link to comment Share on other sites More sharing options...
livepjam Posted September 26, 2006 Share Posted September 26, 2006 I believe it would truly make it a boolean, i.e. false. Quote Link to comment Share on other sites More sharing options...
newb Posted September 26, 2006 Share Posted September 26, 2006 whats a boolean Quote Link to comment Share on other sites More sharing options...
tleisher Posted September 26, 2006 Share Posted September 26, 2006 A boolean is a true/false test, it always returns True or false, nothing more. Quote Link to comment Share on other sites More sharing options...
livepjam Posted September 26, 2006 Share Posted September 26, 2006 Eh, I'm not sure now...I tried the following code and it output the text:[code]<?php$blah = false;if (empty($blah))echo "It is empty";?>[/code]I guess that would mean the variable is empty. Quote Link to comment Share on other sites More sharing options...
Tandem Posted September 26, 2006 Author Share Posted September 26, 2006 I just tried:[code]$blah = false;echo "$blah";[/code]and got no output, so yeah i guess it must be empty. Quote Link to comment Share on other sites More sharing options...
livepjam Posted September 26, 2006 Share Posted September 26, 2006 It is empty, but it still holds the value false.[code]<?php$blah = false;if ($blah == false)echo "It is empty";?>[/code]If you do that, it outputs the echo. Quote Link to comment Share on other sites More sharing options...
Tandem Posted September 26, 2006 Author Share Posted September 26, 2006 Ok cool, thanks for the replies. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.