Note that in web programming a common convention for
multi-word identifiers is to use an underscore to
separate the words, rather than using capital letters
at the beginning of each word after the first, but this
latter way of writing names (the so-called "camel notation")
may also be used, if you wish.
-
JavaScript
-
JavaScript names must begin with a letter, an underscore
(_), or a dollar sign ($). Subsequent
characters can be any of these, or a digit. In JavaScript
the use of an initial ($) is discouraged for
regular programmers.
Examples
cost, cost2, $cost, _cost, cost_per_item
-
PHP
-
PHP names use letters, digits and the underscore (_).
All varibles begin with a $.
Examples
$cost, $my_costs, do_it
-
Perl
-
Perl names use letters, digits and underscores, with an
initial letter or underscore. Variables are special, and
unusual, in that scalar variables start with a leading
$, array variables start with a lealding @,
and hash variables start with a leading %.
Examples
$cost, @my_costs, %names_and_costs, do_it