Original source: http://reinholdweber.com/?p=3
1. If a method can be static, make a static declaration on it. The rate can be raised to 4 times times.
2.echo is faster than print.
3. Use Echo's multiple parameters (meaning to use a comma instead
A simple realization of the color word
The above program just expresses some of the basic principles of color words, to achieve more complex and beautiful color words, all you have to do is change the font, change the font color, add some
Php curl functionBasic example 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 headerCurl_setopt ($
1. Do not translate html entitiesA basic knowledge: all untrusted input (especially the data submitted by the user from the form) must be converted before output.Echo $ _ GET ['usename'];This example may be output:This is an obvious security risk,
Use PHP to describe the bubble sorting and quick sorting algorithms. The object can be an array.Using PHP to describe sequential search and binary search (also called semi-query) algorithms, the efficiency of sequential search must be considered.
Each time you use curl, you always need to check a bunch of data.Now we can save a few frequently used sentences, saving every time we go to Google.Common curl requests: The code is as follows:Copy code $ Url = 'http: // www.111cn.net ';$ Curl =
In PHP, you can easily use the following statement to disable page caching, but it is difficult to remember it for your convenience.Php code The code is as follows:Copy code // Set the expiration time of this page (expressed by Greenwich Mean
PHP comes with a function to generate a unique id: uniqid (), which is based on the number of microseconds of the current time. Its usage is as follows: The code is as follows:Copy code Echo uniqid (); // A 13-bit stringEcho uniqid ("php _"); //
There are many calendars written in JavaScript on the internet. These calendars read local time and may be inaccurate. So I want to find a calendar written in php that can read the server time, but I still cannot find a suitable one, so I tried to
In my opinion, the Class used in PHP is an informal language and cannot be determined whether it is correct.Creating a class is simple:Class my_class {}What is the class? Many people refer to it as a black box. Here I call it an independent whole.
Board. php is used to store data. You can add a message record in it first.Code$ Board = array (Array (1081410332, 'test', 'Test message topic ', 'http: // www.piscdong.com '));?>Index. php is the page for message display and
In fact, this problem has nothing to do with the language used to export csv files. When a number is displayed in Excel, if the number is greater than 12 digits, it is automatically converted to the scientific notation; if the number is greater than
Business Background: yourcmd is my linux program, which has strict permission requirements. When using php to execute yourcmd programSystem: CentOS 6.3Apache is the execution user of php.Execute the program/usr/local/yourcmd/sbin/yourcmd on linux
Cause analysisOther causes for returning NULL in json_decode ($ str:1. $ str can only be UTF-8 encoded2. The element cannot end with a comma (different from the php array)3. Elements cannot use single quotes4. The element value cannot be empty or \
Modify your php configuration and remove the semicolon from; extension = php_curl.dll in php. ini;Restart apache to test whether it works. Generally, it is okay. If it still doesn't work, we can1. Set the three files in the PHP
According to the official explanation1. $ GLOBALS ['var'] is an external global variable.2. global $ var is an external reference or pointer with the same name as $ var.Let's take a look at the following example:For example: The code is as follows:
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