Home >Backend Development >PHP Tutorial >Local variables and global variables in php_PHP tutorial
How to understand scope in PHP? Let’s introduce local variables: variables declared inside functions. Global variables: Variables declared outside the function should be explained in detail
7.2.8 Convert local variables into global variables
The code is as follows
|
Copy code
|
||||||||
$a = 5;
output 10
7.2.9 Use of super global variable $GLOBALR
Statement: The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn Previous article:Introduction to commonly used file operation reading and writing functions in PHP_PHP TutorialNext article:Introduction to commonly used file operation reading and writing functions in PHP_PHP Tutorial Related articlesSee more |