Tuesday, January 16, 2018

PHP Identifier


An identifier is simply a name. In PHP, identifiers are used to name variables, functions, constants, and classes. The first character of an identifier must be an ASCII (American Standard Code for lnformation Interchange) letter (uppercase or lowercase), the underscore character ( _ ), or any of the characters between ASCII 0x7F and ASCII 0xFF. After the initial character, these characters and the digits 0–9 are valid.

Monetize your website traffic with yX Media

Some Identifier name are :-
●    Functions
●    Constant
●    Variable
●    Classes

Variable names :- 

Variable names always begin with a dollar sign ( $ ) and are case-sensitive. Here are some valid variable

Here are some illegal variable names:

$not valid



These variables are all different due to case sensitivity:-





Function names:-

Function names are not case-sensitive (functions are discussed in more detail in Chapter 3). Here are some valid function names:-

These function names refer to the same function:-

howdy     HoWdY       HOWDY      HOWdy howdy

Class names :-

Class names follow the standard rules for PHP identifiers and are also not case-sensitive. Here are some valid class names:



The class name stdClass is reserved.


A constant is an identifier for a simple value; only scalar values—Boolean, integer, double, and string can be constants. Once set, the value of a constant cannot change. Constants are referred to by their identifiers and are set using the define() function:- READ MORE

define('PUBLISHER',           "O'Reilly &




Please comment and follow this site blog inbox