The scope of a variable is the context in which it is defined (that is, the scope in which it takes effect). Most PHP variables have only a single scope. This single scope span also includes files introduced by include and require.
For example:
The code is as follows | Copy code | ||||||||
include 'b.inc';?>
|
The code is as follows | Copy code | ||||||||
$a = 1; /* global scope */
} Test(); ?>
First, an example of using global: Example #1 Using global
Related labels:
Previous article:Implementing asynchronous calling of multi-threaded program code in PHP_PHP tutorial
Next article:Introduction to various methods of generating html files in php_PHP tutorial
Statement of this Website
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
Latest Articles by Author
Latest Issues
When adding sublime3 to compile system php, use the PHP toolbox, cmd php -v is useless
From 1970-01-01 08:00:00
0
0
0
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|