Thanks for all the replies.

I just seemed to me that to add $ everywhere was more work (and not as
aesthetic as a plain word) than using some other syntax for print. But, in
fact, it could have been designed so you could still use

        print "I'm a $variable";

without the use of $ in other uses of the variable (like in assignments and
references to it), right? Rhetorical question.

(Just an initial impression of PHP)...

Bruce


-----Original Message-----
From: Jason Wong [mailto:php-general@;gremlins.com.hk]
Sent: Tuesday, November 12, 2002 11:40 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Why $ on variable names?


On Wednesday 13 November 2002 02:35, Leif K-Brooks wrote:
> I'm just guessing here.  For one thing, to seperate variables from
> constants.  Also, it makes it possible to use variables within quotes.

Yup. So you can have:

  print "I'm a $variable";

instead of the messy javascript way:

  alert("I'm a " . $variable);

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Aleph-null bottles of beer on the wall,
Aleph-null bottles of beer,
You take one down, and pass it around,
Aleph-null bottles of beer on the wall.
*/


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

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

Reply via email to