RE: [PHP] Why $ on variable names?
| From: | Jonathan Rosenberg \(Tabby's Place\) | Date: | Tue, 12 Nov 2002 20:59:45 +0000 |
| Subject: | RE: [PHP] Why $ on variable names? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-124063@lists.php.net to get a copy of this message | ||
In an earlier message, Jason Wong [mailto:php-general@gremlins.com.hk] said
...
> Yup. So you can have:
> print "I'm a $variable";
> instead of the messy javascript way:
> alert("I'm a " . $variable);
But the language could still support variable evaluation within strings
without requiring the '$' to always appear in front of a variable name.
So, a '$' within a string would mean "treat the following identifier as a
variable to be evaluated". I believe that this introduces no
inconsistencies & removes the ugly $s that litter PHP programs.
--
JR