<p>This course will talk about what global variables are in PHP and how they differ from local variables. The reader will also learn how to use the GLOBALS associative array instead of the Global keyword. Explanations will be given using concrete examples.</p> <p>In the PHP programming language, there is a concept of global variables. But first we should remember about local variables. The latter are defined inside a user-defined function (inside a subroutine), and you can refer to it only in that function. Thus, a local variable is available only inside the function in which it is defined (available in the local scope).</p> <p>GLOBALS is an associative array, its key is its name, its value is the contents of the global variable. It is important to pay attention to the fact that $GLOBALS can exist in almost any scope, which is explained as follows: this array is superglobal.</p> <p>Buy the course and get new knowledge!</p>