Closed Thread Icon

Topic awaiting preservation: Empty and Null Pages that link to <a href="https://ozoneasylum.com/backlink?for=13115" title="Pages that link to Topic awaiting preservation: Empty and Null" rel="nofollow" >Topic awaiting preservation: Empty and Null\

 
Author Thread
Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 03-29-2004 06:33

Hi, guys. Long time no see. How are you doing?
I have a question.
What is the difference between Null and Empty?
If something has Emtpy value, does that mean it is 0?
If so, fine.
But what is Null???
Please help.

Hiroki Kozai

abb
Bipolar (III) Inmate

From: Victoria, BC
Insane since: Mar 2002

posted posted 03-29-2004 07:14

Hi Hiroki,

Technically null means without a value, while empty is usually used in context with strings to mean a 0 length string.
In some languages, the concept of null and empty are important to distinguish. PHP is a language where NULL and empty are very similar and are sometimes used interchangably

An empty value does not necessarily convert to 0. It depends on what language you're using.

In PHP, the null value only shows up if you don't set the value of a variable (eg $a), if you set a variable to null (eg $a = NULL), or if you unset a variable (eg $a = 5; unset($a)).
Reference: http://ca.php.net/manual/en/language.types.null.php

In PHP, a null value will be converted to an empty string when you print(), echo() or strval() a string. It will also be converted if you compare a NULL value to a string, or if you cast a null value as a string (eg (string)$a).
Reference: http://ca.php.net/manual/en/language.types.string.php

________
Bradford

[This message has been edited by abb (edited 03-29-2004).]

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 03-30-2004 04:20

Hi, mate. Thanks a lot.
I am doing vb6, mate.
Thanks for your help.

Hiroki Kozai

« BackwardsOnwards »

Show Forum Drop Down Menu