first, pseudo-type
There are three types of PHP pseudo-types, namely: 1,mixed mixed type. 2,number the numeric type. The 3,callback callback type.
1,mixed Mixed type:
Mixed shows that a parameter can accept many different types, but not all of them.
Boolean-Type Boolean
For programming languages, if they need to be judged, they know only true (true) and False (false), 1 and 0, which are simple judgments that are set up and not tenable.
Boolean only two: True true, and false false
For example,
This article mainly and you introduced the PHP odd and variables related data, this example code combined with text description, to introduce you to the very detailed, need to refer to friends, hope to help everyone.
Example
"; eval ("\ $str = \" $
This article mainly introduces the usage of smarty variable modification in php, and analyzes common techniques of smarty template variable modification. For more information, see the example below. Share it with you for your reference. The specific
This article mainly introduces the usage of reserved variables in the PHP template engine Smarty. a more detailed analysis shows the functions and usage of reserved variables in the Smarty, for more information about reserved variables in the PHP
1. Local Scope
function Update_counter ()
{
$counter ++;//here $counter as a local variable, not the same as $counter outside the function
}
$counter = 10;
Update_counter ();
Echo $counter;
Output: 10
2. Global Scope
function
Take a look at the following example:
Copy CodeThe code is as follows:
function Test ()
{
$w 3sky = 0;
echo $w 3sky;
$w 3sky++;
}
?>
Each call to this function sets the value of $w 3sky to 0 and outputs "0". Adding a variable to the $w 3sky++
How does PHP use the global variable & lt ;? Phpglobal & nbsp; $ vfp_oledb_CString = "Provider = VFPOLEDB.1; Data & nbsp; Source = d:/testol PHP how to use global variables
The first method: $varname =null
Second method: Unset ($varname)
Both of these methods can delete variables, but the results are slightly different.
Code:
Copy CodeThe code is as follows:
$a = Array (
' A ' = ' a ',
' B ' = ' B '
);
$b = Array (
'
1. you can use session_register to register global variables available throughout the session. For example, session_register ("name") registers a global variable $ name, which can be directly used on the PHP page, if you want to use $ name in a
Even if you develop a new large PHP program, you must use global data, because some data requires different parts of your code. Some common global data includes program setting, database connection, and user data. There are many ways to make this
[1] indirect reference of variables:
The output above is 123
We can see that there is another $ in the second line of code, and the variable is accessed through the specified name, the specified name is stored in $ a ('B, change the value of $
Static variables only exist in the function scope. That is to say, static variables only exist in the stack. Generally, variables in a function are released after the function ends, such as local variables, but static variables do not. That is to
Variables in PHPThe program is composed of two parts: the code and the data, the data is stored in the variable, the nature of the variable is a storage space in memory. Variables corresponding to the space has a name, called the variable name, the
Save the following code as test. php {code ...} test this code locally and access urllocalhosttest. phpa $ _ SERVER [& #039; PATH_INFO & #039;] value: & #039; a & #039;. After the value is assigned, $ _ SESSION [& #039; the value of test & #039;] Is
1, value assignment, such as $a=1, $b = $a, etc.;
2, reference assignment, such as $a=& $b, that is, $ A and $b in both points to the memory of the same storage variable worth the address;
3, the reference count, the object in both PHP and JS is
To analyze the problem, you need to call the data of A function (currently called function A) and have executed global $ _ G to call global variables, the $ _ G output through print_r also confirms that $ _ G contains data and the plug-in cache is
$coupons = Pdo_fetchall ("SELECT * from". TableName (' wangniu_activity '). "Where flag = 0 and isopen = 1 and Ischeck = 1 and Start_time ". Time ()." And Weid = ". $weid." and StoreID = ' ". $id." ". ORDER BY type ASC ");
Where SQL execution is:
Author: sports98 2002-8-16After PHP4.1.0, HTTP_GET_VARS is saved using the GET variable. The GET variable mainly comes from the following methods:For example, the URL that requests the server to obtain information, use the form method as the get
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.