Jump to content

Archived

This topic is now archived and is closed to further replies.

Tandem

false

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
I just tried:

[code]$blah = false;

echo "$blah";[/code]

and got no output, so yeah i guess it must be empty.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.