Re: [PHP] [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)

2005-05-05 Thread Rasmus Lerdorf
James Williams wrote:
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
 
 
 You are however, when dealing with OOP and classes required to declare
 you're variable, right?

You can, but you don't need to.  Try it.

-Rasmus

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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

2005-05-04 Thread Jon M.
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??


-Jon 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] [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)

2005-05-04 Thread Rasmus Lerdorf
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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] [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)

2005-05-04 Thread bala chandar
Hi

On 5/5/05, Jon M. [EMAIL PROTECTED] 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;

I think you can do like this inside a class
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

check out http://www.php.net/manual/en/language.variables.php

 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??

when u use OO concepts, then you can use var. other wise its not neccessary.

 
 -Jon
 


-- 
bala balachandar muruganantham
blog lynx http://chandar.blogspot.com
web http://www.chennaishopping.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] [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)

2005-05-04 Thread James Williams
 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

You are however, when dealing with OOP and classes required to declare
you're variable, right?


-- 
jamwil.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php