Identifiers

Identifiers give names to the abstract parts of PHP: functions, variables, and classes. Some of them are created by PHP in the form of built-in functions or environment variables. Others you create. Identifiers may be of any length and can consists of letters, numbers, or underscores. The first character of an identifier must be either a letter or an underscore. Table 2.1 contrasts acceptable identifiers with unacceptable ones.

Upper- and lowercase letters are recognized as different. That is, the variables UserName and username are two distinct identifiers. The exception is built-in functions. As stated in Chapter 1, "An Introduction to PHP," functions like print can be called as Print if you prefer.

Table 2.1. Acceptable and Unacceptable ...

Get Core PHP Programming: Using PHP to Build Dynamic Web Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.