RE: [PHP] Why $ on variable names?

From: Date: Tue, 12 Nov 2002 18:51:24 +0000
Subject: RE: [PHP] Why $ on variable names?
Groups: php.general 
Request: Send a blank email to php-general+get-124050@lists.php.net to get a copy of this message
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: php-general@lists.php.net 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

« previous php.general (#124050) next »