Category PHP

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,…

Global Variables in PHP

Global variables in PHP are those variables which are declared outside of any function and accessible throughout the program. This means that you can access global variables anywhere, inside and outside the functions. In simple words, global variables can be…

Local Variables in PHP

In PHP, there are three types of variables: local, global, and static variables. In this tutorial, we will understand local variables in PHP and their scope with the help of examples. Later on, we will understand on global and static…