Php random generation of image verification code
Session_start ();
// A string that randomly generates the verification code
Function random ($ len ){
$ Srcstr = "ABCDEFGHIJKLMNPQRSTUVWXYZ123456789 ";
Php uses memcached cache to add, delete, modify, and query data
// Create a memcache object instance
$ Memcache = new Memcache;
If (! $ Memcache-> connect ("127.0.0.1", 11211 )){
Die ('connection
Nice php + mysql paging class
/*****************************
* @ Class name: page
* @ Parameter: $ myde_total-total number of records
* $ Myde_size-number of records displayed on one page
* $ Myde_
Php paging principle simple paging code summary
// Determine the number of entries displayed on each page
// Count (*) queries the total number of items
// Calculate the total number of pages ceil ()
//
How does php determine the image color type? Instance tutorial
$ I = imagecreatefromjpeg ("image.jpg ");
For ($ x = 0; $ x
For ($ y = 0; $ y
$ Rgb = imagecolorat ($ I, $ x, $ y );
Php checks whether there are simple examples of images in the article
$ Url = "http: // XXXXX/article/012.html ";
$ Content = file_get_contents ($ url); // read the source code of the article page
If
Code igniter helper function helper usage
$ This-> load-> helper ('name ');
Here, name is the name of the helper function File (without the. php suffix and "helper ).For example, to load the URL Helper file named
PhpCURL: an example of simulating logon to the Zhengfang educational administration system
$ Url = ''; // logon address of the Zhengfang educational administration system
$ ID = '';
$ PA = '';
$
Php server variable $ _ SERVER usage
For details about the usage of the php server variable $ _ SERVER and the server variable $ _ SERVER, some common variables $ _ SERVER are used. For more information, see.
SERVER variable $ _
Example of intercepting the length of a Chinese character using a php custom function
Function msubstr ($ str, $ start, $ len ){
$ Strlen = $ start + $ len;
For ($ I = 0; $ I
If (ord (substr ($ str, $ I, 1)>
Example of using the CodeIgniter class library to upload images
2. file Upload class:
Public function img_upload ()
{
$ This-> load-> helper ('URL ');
$ Config ['upload _ path'] = '
PHP template engine Smarty cache usage
$ Smarty-> display ('index. tpl ', $ my_cache_id );
This feature can be used to cache different $ _ GET objects.II. clear the smarty cache there are several methods to clear the
Usage of SplFileObject for PHP to read large files
/** Return the content of the file from row X to Row Y (php5 and php4 are supported)
* @ Param string $ filename file name
* @ Param int $ number of rows
Phpsocket function list
This article shares common functions in the php socket function library. if you have any friends who are studying php socket programming, refer to this document.
Php socket function library:Function name
Php Chinese character transcoding Unicode (UTF8) to GBK encoding conversion
// Php Chinese character transcoding
Class qswhU {
Var $ qswhData;
Function qswhU ($ filename = "qswhU. php "){
$ This->
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