First, write a good interface program
Upload an interface program file on your server, such as the http://www.yourdomain.com/weixin.php content as follows:
Copy Code code as follows:
Define ("TOKEN", "Weixin");/the TOKEN that you
Traverse the directory and the result is stored in an array. Support PHP4 and above. PHP5 can replace the while loop with the Scandir () function later.
Copy Code code as follows:
/**
* @param string $dir
* @return Array
*/
function
Using MVC in PHP has become increasingly popular, especially in some open source frameworks. MVC is enough to deal with most situations, but there are some things that are not appropriate, such as simple personal blog, for only hundreds of article
Caching namespaces
The memcache itself does not support namespaces, but we can use the mechanism of the memcache itself to simulate namespaces. For example, if you want to clear a set of data, you need to use a namespace, to see an example, the
PHP implementation of the maximum number of positive and negative array of sub-sequence, the array of numbers, which consists of positive and negative digits, to find the array of contiguous elements of the maximum size of the child array.It's
This article will continue to explain how to interact with the database through this example. Examples are used in MySQL, can also be replaced according to their own needs of other databases, and its connection can be referred to PHP related manuals.
1, in a function, when passing an array
Using return is more efficient than using global
Like what
function Userloginfo ($usertemp) {
$detail =explode ("|", $usertemp);
return $detail;
}
$login =userloginfo ($USERDB);
Than
function Userloginfo
The imagick portion of the image library developed for the bone system supports GIF, which supports trimming, generating thumbnails, and adding watermarks.
Supports generation of thumbnail images by orientation, such as:
The upper left
And it's 3 times times worse than the efficiency. So, the recursion in PHP must be treated with care.
Recently wrote a fast sorting algorithm, found that the recursive efficiency in PHP can not be across, in a variety of servers, may behave
But if the array is bigger, the performance will drop, and it will run a little longer, so if you're optimizing for a large array, here are two ways to do it (all through custom functions):
1. Array key and value flip through isset to determine
At that time, compared to IIS, it is too bad, because in IIS, you can set up a site or even a directory access in the anonymous account, as long as each site to use the same account, the site security will not affect each other. These days just
No matter how many headers the page has, it executes the last one, but it is conditional, for example:
Header (' location:http://www.jb51.net ');
Header (' location:http://www.g.cn ');
Header (' location:http://www.baidu.com ');
This will jump to
A simple example is calculating the number of days to borrow, which requires PHP to calculate on a daily basis, and here's a few ways to implement this date calculation:
(1) If there is a database is very easy! If MSSQL can use triggers! A function
No different, the following content, is for a Java programmer to master the skills of PHP to compare! Tell you, they are the same, but only tools, no high and low points.
Only you are not skilled, do not know!
1, syntax: Must be more familiar with,
have been trying to write this, after a long time today's interest to simply record.
Verification Code
Fully automatic distinction between computer and human public Turing Test (English: Completely automated-Turing test to tell Computers and
memcacheQueue.class.php
Copy Code code as follows:
/**
* PHP Memcache Queue class
* @author lkk/lianq.net
* @version 0.3
* @ Modification Instructions:
* 1. Abandoned the previous AB rotation idea, using a similar array of constructs,
This article is an example of the implementation of PHP SCWS Chinese Word segmentation search method. Share to everyone for your reference, specific as follows:
1, 4 files (site download address. ) after decompression, put it in a place
This example describes the PHP custom paging class. Share to everyone for your reference, specific as follows:
each_disnums=intval ($each _disnums);
$this->nums=intval ($nums);
if (! $current _page) {$this->current_page=1;
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