(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 =
As follows:Copy codeThe Code is as follows:Function makeAcquire ($ nUsers, $ nAwards){// Update the database$ TranDb = new Model ();$ TranDb-> startTrans ();For ($ I = 0; $ I {// Update the Acquire table$ FlagAc = $ tranDb-> table ('acquire ')-> add
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
In fact, there are dozens of items, but because there is a large amount of data to be operated, a small program is added to solve the problem. The data that was not processed yesterday can be processed, as shown below:Copy codeThe Code is as follows:
Enterprise websites require at least one virtual host. However, OA, finance ...... These internal systems are hard to say. They can't always throw the code and database to others, write a description, let them configure the environment according to
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
--- Space ---String GBspace (string) --------- Add a space between each textString GBunspace (string) ------- clear spaces between each textString clear_space (string) ------- used to clear unnecessary Spaces--- Conversion ---String GBcase (string,
$ Len indicates the length. The Code is as follows:Copy codeThe Code is as follows:/*** Generate random strings** Generates a random string of the specified length and returns it to the user.** @ Access public* @ Param int $ len: number of digits of
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
Now we start to install and configure:1. The PHPMyAdmin package downloaded from the internet is usually released to the htdocs directory, for example, htdocs \ phpmyadmin.2. Open the phpmyadmin directory and check whether the config. sample. inc.
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