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
1. Constructs the music message which the micro-letter provides in the XML formatThe XML format for music is this:
Copy Code code as follows:
12345678
We write a function to convert the data into
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 is a lightweight framework designed to quickly develop restful interfaces. If you're as tired as I am, using the traditional MVC framework to write micro-services or the end-to-end separation of API interfaces, you can't stand a lot of extra
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
Share an auxiliary function, using PHP to identify the numbers in the string as much as possible,
First up code
function Checknatint ($str) {$map = array (' One ' => ' 1 ', ' two ' => ' 2 ', ' Three ' => ' 3 ', ' Four ' => ' 4 ', ' Five ' => '
Note: In this example, the Web service is constructed using a SOAP method, which is used to build the SOAP server through the PHP plug-in nusoap.
Copy Code code as follows:
?
Require_once ("lib/nusoap.php"); Call Nusoap
$server = new
Basis
Common Methods for cookies:
$_cookie[' Recordluhuidudu '] get cookiesSetcookie (' Recordluhuidudu ', ", Time () -3600*24*30); Setcookie (field name, data, expiration time); Set cookies
Attention
The same way to delete cookies is to reset
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
Morning just to the company, the head told me, to write a small function, used to statistics specified in the directory file size, I have a go, do it, fortunately a little foundation, a will be completed, haha. The code is below.
?
/**
This article describes the PHP asynchronous call method , share for everyone to reference, the specific content as followsThe client and server are connected through the HTTP protocol, the client initiates the request, the server side receives the
Several ways to delete array elements in PHP in many cases, our array will be duplicated, so we delete some of the duplicates in the array, and the elements must remain unique, so we just want to remove them, and here are several ways to remove the
This article illustrates the PHP upload image and compression of the implementation method, a previous "PHP implementation picture upload and compression" has been for everyone a brief introduction, the implementation of upload pictures and then
This article illustrates the PHP image upload and compression of the implementation method, share for everyone to reference, the specific content as follows
Use to three files
connect.php: Connecting to the database
test_upload.php:
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