[suspicious - maybe spam] Re: [suspicious - maybe spam] [PHP] Simple question: How to declare Vars in PHP? (I know it's not necessary, but I still
want to know)

From: Date: Thu, 05 May 2005 02:47:56 +0000
Subject: [suspicious - maybe spam] Re: [suspicious - maybe spam] [PHP] Simple question: How to declare Vars in PHP? (I know it's not necessary, but I still
want to know)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-214475@lists.php.net to get a copy of this message
Jon M. wrote: > I know in JavaScript, that you declare vars like so: > > var = variableName; > > So I'm assuming that in PHP you do it like this: > > var = $variableName; > > But there doesn't seem to be a single shred of documentation on PHP.net (or > in ANY book) that covers this. All they say is that it's good practice, but > not necessary. Then they always skip telling you how. > > I always like to declare vars since it helps me keep track of the vars I > will be using, and I just like to do things right. > > So am I right about how you do it? "Yes", "No", example please?? No You don't declare variables in PHP. You just start using them. Perhaps you mean assign? Since your example of var = variableName; is actually an assignment in Javascript. In PHP you simply do: $one_var = $another_var; -Rasmus

« previous php.general (#214475) next »