Category PHP

Magic Constants in PHP

Magic constants are special types of predefined constants in PHP whose values change depending on where they are used in the script. They provide useful information about your code, such as the current file name, directory name, function, class, and…

PHP Constants

A constant is PHP is a name or an identifier for a value which remains fixed and never change throughout the program. In other words, a constant is a variable whose value does not change at runtime after being defined.…

Superglobal Variables in PHP

The variables that are predefined in PHP are known as superglobal variables. These predefined or built-in variables are always accessible, regardless of scope (global or local). Therefore, you can access them from any part of the program such as functions,…

Variable Scope in PHP

The variable scope in PHP defines the area or region of within the program where a particular variable is visible or accessible. In other words, a variable scope refers to the part of PHP program within which you can access and…

Static Variables in PHP

Static variables in PHP are those variables that retain the values even after the function exits. In other words, variables which hold their values between multiple function calls are called static variables. When the execution of a function is completed,…