Identifier:
The functions, variables and various other user defined object is known as Identifier.
Identifiers must start with a underscore and letter.
-> Identifier must be case sensitive.
$recipe,$Recipe,$recipE= all these are different from each other.
->Identifier can be lengthy.
->Identifier should not be any keyword of PHP.
Variable:
A variable is a name to which memory is located that contains data for manuplating the complete program.
A variable always starts with the $.
$color
$operating_system
$_some_variable
$model
Variables too have same rules of identifier.
$sentence = "This is a sentence."; // $sentence evaluates to string.
$price = 42.99; // $price evaluates to a floating-point
$weight = 185; // $weight evaluates to an integer.
We can use variable anywhere in the program. Therefore, variable will get accessed wherever it is necessary.
Therefore, the access domain name is Scope.
Variable scope:
Scope can be the range of availability of variable in a program in which it is declared.
The functions, variables and various other user defined object is known as Identifier.
Identifiers must start with a underscore and letter.
-> Identifier must be case sensitive.
$recipe,$Recipe,$recipE= all these are different from each other.
->Identifier can be lengthy.
->Identifier should not be any keyword of PHP.
Variable:
A variable is a name to which memory is located that contains data for manuplating the complete program.
A variable always starts with the $.
$color
$operating_system
$_some_variable
$model
Variables too have same rules of identifier.
$sentence = "This is a sentence."; // $sentence evaluates to string.
$price = 42.99; // $price evaluates to a floating-point
$weight = 185; // $weight evaluates to an integer.
We can use variable anywhere in the program. Therefore, variable will get accessed wherever it is necessary.
Therefore, the access domain name is Scope.
Variable scope:
Scope can be the range of availability of variable in a program in which it is declared.