This article mainly introduces the various definition variables in PHP method summary, the need for friends can refer to the following
1. Define constant define ("CONSTANT", "Hello World");
Constants can only contain scalar data
This article provides a detailed analysis of several methods for using global variables in PHP. For more information, see
IntroductionEven if you develop a new large PHP program, you must use global data, because some data requires different parts
System variables and environment variables in php
This article describes how to learn about system variables and environment variables in php.In daily php programming, system variables and environment variables are sometimes modified to
Learning Super global variables in php
Since PHP 4.2.0, the default value of register_globals is off. as a result, many variables can be used directly in the past, for example, $ PHP_SELF or the set SESSION variable cannot be accessed in
This article provides a detailed analysis of several methods for using global variables in PHP. For more information, see
IntroductionEven if you develop a new large PHP program, you must use global data, because some data requires different parts
The basic usage of static variables in php. Static variables only exist in the function scope, and static variables only exist in the stack. Generally, variables in a function are released after the function ends, such as local variables, but static
Destroy session variables in PHP. 1. what is session? It is equivalent to an access to the server from a client (which can be a browser, app, ftp, and other clients, and several more clients can be opened in the same browser,
1. what is session?It
1. Magic Constants
There are eight magic constants in PHP, and their values change as they change position in the code. These special constants are case insensitive.
Line: Returns the current row number in the file. Can also be written in
This article mainly introduces the PHP constants and variables examples of the relevant information, the need for friends can refer to the following
Examples of constants and variables in PHP
"PHP receives parameters under command line"
If you
examples of constants and variables in PHP
"PHP receives parameters under command line"
If you debug PHP at the command line, the incoming parameters are obtained through $ARGV, note that the file name contains the element, and the number of
Another important feature of the scope of variables in PHP is the static variable (the statics variable). Static variables exist only in the local function domain and are initialized only once, and when the program executes away from this scope, its
Sometimes variable names bring great convenience to programming. That is to say, the variable name can be dynamically named and used. Generally, variables are named by the following statement: & lt ;? Php $ ahello ;? & Gt; variable name refers to
PHP has built in some super global variables that we can use and visible anywhere in the script, and we'll take a look at these global variables:1, $_serverThe $_server Super global variable contains information created by the Web server that
js call PHP variables, how to get the example on the Web is a JS file in the beginning to give this variable a value, if that is what the meaning of Ah, I want is can change. hychyc_2008 | browse 2,741 times 2013-04-18 12:24 2013-04-20 10:34Best
The super global variable in PHP starts with PHP 4.2.0, the default value of Register_globals is off, so many variables that can be used directly, such as $PHP _self or the session variable you set, cannot be accessed in the form of "$ variable name"
Use global variables in PHP and $globals[]
In PHP development projects, will inevitably use the global variables, such as some Web site configuration information, the whole station general, it can be set in one place, and then multiple places to
Understanding the scope of a variable
Scopes are scopes that a variable can use or be visible in a script. PHP has 6 basic scope rules:
Built-in super global variables can be used and visible anywhere in the script.
constants, once declared,
An error is reported for MYSQL variables in PHP. $ SQL = 'set @ rank = 0; & nbsp ;. 'select * FROM (SELECT @ rank: = @ rank + 1 ASrank, yb2000_event_phone, and yb2000_e report an error to the MYSQL variable in PHP.
$ SQL = 'set @ rank = 0;
. 'Select
The _ FILE ,__ CLASS and other magic variables in PHP today saw a magic variable, which was never seen before, __dir __. I checked it and found it was added by php5.3, by the way, let's take a few examples to explain the complete path and FILE name
Talking about the scope of include file variables in php,
In php, we sometimes need to include a file. For example, when I was writing a framework some time ago, I planned to use the native php as the template and then write a display method to
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.