Re: Initializing variables

From: Date: Sat, 06 Nov 2004 01:32:26 +0000
Subject: Re: Initializing variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-201349@lists.php.net to get a copy of this message
What I want to know is if the variable assignment is unknown, as in a user form. Would I then just initialize the variables to 0 ? Stuart
// I assign null to the variable if I'm not sure what type it's going to have. $var = null; // 0 and FALSE are also ok choices, I try to use them for integers or booleans // If you're talking about I think you're talking about (register_globals) then // isset() won't suffice because the $_POST and $_GET indices get registered as // global variables automatically.

« previous php.general (#201349) next »