"Base" PHP variable and variable scope, PHP variable scope
The newly-learned PHP, more interesting syntax, recorded.
1. Scope of variables
The scope is only two global and local,global relative to the entire. php file, Local is the minimum range,
[Basics] PHP variables and variable scopes, and php variable scopes. [Basic] PHP variables and variable scopes. php variable scopes are newly learned. interesting syntax is recorded. 1. the scope and scope of variables are divided into two Global
Variable scope is a variable between the page and function can use each other, its scope of action, the following small series to introduce you to the PHP variable using the domain of some learning notes to get out and exchange with you.
The scope
Php variable scope learning notes sharing. Variable scope is the scope of a variable that can be used between pages and functions, the following small series will introduce some learning notes about the use of php variables in the domain. the
The scope of the variables in PHP is described in the PHP manual
In a user-defined function, a local function range is introduced. Any variable that is used inside a function is limited by default to the scope of the local function. For example:
Variable scope is the scope of a variable that can be used between pages and functions, the following small series will introduce some learning notes about the use of the php variable domain to share with you. In php, the scope of variables is
Each programming language, its variables have a certain range of valid, beyond this range, the variable is invalid, which is the scope of the variable. From the point of view of mathematics, it is the field of the independent variable.
Scopes are
Concept of scope:
Variables can be declared anywhere in the PHP script, but declaring the location of a variable greatly affects the scope of the access variable. This accessible scope is called scope.
The main commonly used include: local
This article mainly introduces the scope of PHP variables and address reference. if you need it, you can refer to the concept of scope:
Variables can be declared anywhere in the PHP script. However, the location of the declared variables will
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.