P> online very free to support PHP's personal home page space now a lot, then may think of a upload something, but it is free, of course, there will be a lot of restrictions, not allowed to upload, this is normal, some even mail () function is not
In the PHP tutorial traversal data We commonly have two methods, using for and foreach operation, the former is to know the length of data, and then the latter can not know the length of the data, we have to illustrate the following separately.
?
PHP Tutorial JSON Chinese garbled processing method
The web-effects client handles the Chinese language using Utf-8, and JSON's handling of Chinese is also
Using Utf-8, therefore, ajax->php when PHP requires utf8->gbk;php to be handled well after
PHP tutorial curl_setopt and impersonate user login
BOOL curl_setopt (INT-ch, string option, mixed value) The curl_setopt () function sets the option for a curl session. The option parameter is the setting you want,
Value is the values given by
1. __construct ()is invoked when the object is instantiated,When __construct and a function with the class name as the function name exist at the same time, the __construct is invoked and the other is not invoked.
2. __destruct ()
Called when an
BOOL file_exists (string filename)
filenamereturns TRUEif the specified file or directory exists, or FALSE.
In fact, PHP tutorial file_exists function and file_exists syntax We've already talked about it, so let's take a look at some of the ways
PHP Example profiling: Counters
Author: Sucre_tiger
This section of the counter with a text count, not used in the database, you can achieve the following functions:
Using a text file to implement multiple page counts reduce server I/O occupancy
Nationally, the criterion is whether $request_uri contains HTMLif (!strpos ($_server["Request_uri"], ". html")){$page = "http://qq.ip138.com/weather/";$html = file_get_contents ($page, ' R ');$pattern = "/ National main cities, counties and the next
excel Data Capture Demo Submit the form
Public Function Parse (){/*** $_files Array description* Array (n) {* [Form file box name] => Array (5) {* [' name '] => submit file name* [' type '] => commit file type Excel to "Application/vnd.ms-excel"*
1,ini_get:returns The value of the configuration option as a string on success, or a empty string on failure (read PHP teaching The value in the path. ini configuration file) 2,; Whether to allow the treatment of URL (like http://or ftp://) as
Preliminary knowledge
Template technology:PHP Template Engine Smarty IntroductionPHP Configuration using Smarty Technology
Caching technology:
such as constant information, but still need to change the information in the cache to speed up the
Prerequisite knowledge
There may be some called magic functions (Magic functions) in a PHP class that automatically trigger when a class does something, such as __construct () when an object is created, and __destruct () is called when an object is
There is a php regular expression mailbox problem The code is as follows:Copy code $ A = '/([w. _] {2, 10}) @ (w {1,}). ([a-z] {2, 4 })/';$ B = '1412316545645454545454545k @ qq.com ';If (preg_match ($ a, $ B )){Echo "the email is valid ";} Else {
You can use a regular expression such as d {5, 10} for numbers ranging from 5 to 10.I thought about the number of 5 to 10 digits that were not repeated, so I had to check the Internet.The RegexBuddy test is successful. The code is as follows:Copy
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