1. unset ($_session[' xxx ') deletes a single session,unset ($_session[' xxx ')) to unregister a registered session variable. The effect is the same as Session_unregister ().
Session_unregister () has been discarded in the PHP5.
Unset ($_session)
A relatively simple php file Upload example, can be used when the request is not high, recorded here, convenient later to use when directly over the copy.
$resume = $_files[' Resumefile '];if ($resume [' name ']!= '){$enableType = array (' jpg ', '
In some applications we need to dynamically display data, such as current online numbers, current total transactions, current exchange rates, and so on, front-end pages need real-time refresh to get the latest data. This article will be combined
First, the file upload
1, client settings:
(1), in
Label Enctype and method two properties to indicate the corresponding values.
Enctype= "Multipart/form-data"; Method= "POST"
(2), form form to set up a hidden type of input box, where the value
Classification of operators
1, by the number of operations classification
1.!true//Unary operators2. $a + $b//two-dollar operator3.true? 1:0//ternary operator
2, according to the function classification
(1) Arithmetic operators1.+ 、-、 x,/,%
Example.
The code is as follows
Copy Code
$test = 0;if ($test = = ") {Echo ' in php, 0 is empty '; is output}if ($test = = = ") {Echo ' in php, 0 is empty '; Not to be output}if ($test ==null) {Echo ' in php, 0 is
Pass Value:
The function parameter pressure stack is a copy of the parameter.
Any modification is a function on the copy and does not work on the original variable.
Pass Reference:The press stack is a copy of the reference. Because a reference is
One: Sequential structureTwo: Branch structure (conditional structure, selection structure)1. One-way branch:Conditions: bool,true or false,> if (condition)Execute one of the following statementsif (condition){Code Snippets:Code
Here are a few ways to jump:
One of the most common methods on the Web:
The code is as follows
Copy Code
$url = $_get[' url '];Header ("Location: $url");?>
Put this code in a folder, named for example go.php
Share a method to meet these two conditions at the same time, not only to facilitate the Web site program error debugging, but also does not affect the normal operation of the site debugging methods. Copy the following PHP statement to the top of
One, about Taobao IP address library
The services we currently offer include:
1. According to the IP address provided by the user, the geographic and geographic information of the IP address is quickly queried, including the state, province, city
In asp,.net, date addition minus is a fairly simple datediff function to calculate how long the difference between two dates is, and when I learn PHP I think so, but completely different from what I think, the following is a friend wrote Php date
? Php
$countfile = "Num.txt";Defines that the file written by the counter is count.txt under the current directory, and then we should test whether the file can be openedif ($fp = fopen ($countfile, "r+")) = = False) {//Open file in read-write mode,
Definition and usageThe explode () function separates strings into arrays.SyntaxExplode (separator, string, limit)ExampleIn this example, we split the string into an array: The code is as follows:Copy code $ Str = "Hello world. It's a beautiful
Strtr (string, from,)Or strtr (string, array)First, the first method for strtr functionsLet's take a look at the example below: The code is as follows:Copy code Echo strtr ("I Love you", "Lo", "lO ");?>The result is:1 I lOve yOu This result
*/$ Hash_list = hash_algos (); // return the registered hash rule listPrint_r ($ hash_list); // display the result/* Create a file to calculate the hash value */File_put_contents('example.txt ', 'The quick brown fox jumped over the lazy dog .');/*
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service