(1) The static method is four times faster than the normal method.(2) echo output is faster than print(3) Use the connection character instead.(4) take the maximum value before the loop, instead of taking the value in the loop.Correct Method$ Max =
Required environment:Php 5.3.3Apache 2.2.7Mysql 5.5.8Download related documents:Click to downloadDecompress the memcached_1.2.5file and execute memcached.exe-d-installDecompress the php5.3 _ vc6_memcachedll file and copy the php_memcache.dll file to
CodeCopy codeThe Code is as follows:// Obtain the start time and end time of the week of the specified date.Function getWeekRange ($ date ){$ Ret = array ();$ Timestamp = strtotime ($ date );$ W = strftime ('% U', $ timestamp );$ Ret ['sdate'] =
CakePHP framework home: http://www.cakephp.org/
Import the downloaded directory to the project. The directory structure is shown in figure (Version: 1.1.19.6305)
Set up the PHP environment. Here AppServ2.5.9 is used.Home
Copy codeThe Code is as follows:// Define a function to call FCKeditorFunction call_fck ($ input_name, $ input_value, $ w = '000000', $ h = '000000 '){Include_once 'fckeditor/fckeditor. php ';$ Fcked = new FCKeditor ($ input_name );$ Fcked->
I developed a novel serialization program a few days ago. For fear of updating problems, I wrote a collector to collect 8-way Chinese network. The function is simple and cannot be customized, however, the general idea is in place, and custom rules
1. In a function, it is more efficient to use return when passing an array than to use global. For example: Function userloginfo ($ usertemp ){$ Detail = explode ("|", $ usertemp );Return $ detail;}$ Login = userloginfo ($ userdb );RatioFunction
On the other hand, you can use a simple line of code to solve a problem.The following are some cool features that you may not have noticed:Use the ip2long () and long2ip () functions to convert an IP address into an integer and store it in the
PHP code:$ Lan = substr (? $ HTTP_ACCEPT_LANGUAGE, 0, 5 );If ($ lan = "zh-cn ")Print (" ");ElsePrint (" ");?>HTML web pages automatically jump to multilingual pages based on different browser languagesAdd the following code between .
// This script is used to enter a password for the user and determine whether the password is correct.// If it is correct, go to the welcome page.If ($ login ){Include ("../include/config. inc. php3 ");Session_start ();$ Right_enter = '0 ';$ Query =
Data TypeInteger: It can be expressed in decimal or hexadecimal notation.Point: A floating point number is composed of a number plus a decimal point and a number. The two numeric sequences cannot be empty at the same time.String: a character or
UTF EncodingThe UTF-8 is coded in 8 bits. The encoding from UCS-2 to UTF-8 is as follows:UCS-2 coding (hexadecimal)UTF-8 byte stream (Binary)0000-007F0 xxxxxxx0080-07FF110 xxxxx 10 xxxxxx0800-FFFF1110 xxxx 10 xxxxxx 10 xxxxxxFor example, the Unicode
Preg_grep(PHP 4, PHP 5)Preg_grep -- returns the array unit that matches the pattern.DescriptionArray preg_grep (string pattern, array input [, int flags])Preg_grep () returns an array containing the units in the input array that match the given
When echo $ showtime = date ("Y-m-d H: I: s") is used to obtain the system time today, it is found that the obtained time is inconsistent with the system time.After some research, we found that the default time set by PHP is based on Greenwich Mean
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