The PHP world of buffering is a hot topic, because the dynamic page generated by PHP, each user request needs to be recalculated, regardless of the request results are the same, and PHP will compile a script each time. This overload is certainly
Set_error_handler ()
PHP provides a functional function of custom error handling handles Set_error_handler () from 4.1.0, but very few scripting people know. Set_error_handler This function is a good way to prevent the wrong path from leaking, and
1.php Interface class: InterfaceIn fact, their role is very simple, when a lot of people together to develop a project, may go to call someone else to write some of the class, then you will ask, how do I know how a certain function of his
Problem description
fopen (), file_get_contents (), getimagesize () and so on are not normal access to the content of the network, the specific performance of any parameter is a URL, all return null value
If Windows can be found
Allow_url_fopen
PHP5.2.17 Official Download: Http://windows.php.net/downloads/releases/php-5.2.17-Win32-VC6-x86.zip
PHP5.3.5 Official Download: Http://windows.php.net/downloads/releases/php-5.3.5-Win32-VC9-x86.zip
First install good IIS7
Command line mode for imagemagic to remove image backgrounds: The code is as follows:Copy code Convert-size 140x80 xc: none-fill gray-gravity northwest-draw "text 'copyright'"-gravity southeast-draw "text 'copyright'" miff: -|
English only The code is as follows:Copy code If (preg_match ("/^ [a-z] * $/I", "fdsFDfd ")){ Echo "all letters"; } Pure Chinese characters The code is as follows:Copy code For example:Var str = "php programming ";If (/^ [u4e00-u9fa5] + $/.
According to the WeChat advanced red envelope interface, the PHP version of the API is developed and the main code analysis is now carried out.The red envelope interface calls the request code. All request parameters are mandatory and correspond to
1. Meaning of the single-state design model:The main function of the single-state mode is to ensure that only one instance object exists in a class in the object-oriented programming design. As the object creation mode, the singleton mode ensures
Let's take a look at how to get the first letter of a single Chinese character. See the following function. It supports GBK and UTF8 encoding: The code is as follows:Copy code Function getfirstchar ($ s0 ){$ Fchar = ord ($ s0 {0 });If ($ fchar> =
I wrote the program code like this. The code is as follows:Copy code ?? Php// Initialize a cURL object$ Curl = curl_init ();// Set the URL you want to captureCurl_setopt ($ curl, CURLOPT_URL, 'http: // www.111cn.net ');// Set the
Function turntopage ($ url = "index. php", $ info = "page redirection...", $ second = 2 ){Print " n n page turning... n ";Print " n"; // open source code 111cn.netPrint " n ";Print " n n ";Print " n ";// 111cn.netPrint " n ";Print " n ";Print "
*/ The code is as follows:Copy code Class template{Var $ temp; // file name of the template page read (including path)Var $ html; // The html file name to be generated (including the path)Var $ err; // error codeVar $ test; // data streamVar $
*/ The code is as follows:Copy code Class upfile {// Upload file informationVar $ filename;// Save the nameVar $ savename;// Save pathVar $ savepath;// The file format is limited. If it is null, the format is not limited.Var $ format = "";//
In the php Tutorial, trim () form verification is not a null instance. It should be an entry-level instance. It tells you how to use the trim function to delete spaces and determine whether the data submitted by the user is empty. contact
Php tutorial programs must look at the optimization method1. If a method can be static, it will be declared as static. The speed can be increased to 4 times.2. echo is faster than print.3. Use multiple echo parameters instead of periods to replace
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