Php-redis Chinese Document 5
This article is the fifth part of the php-redis Chinese document. For more information, see.This article is the fifth part of the php-redis Chinese document. For more information, see.Hash operation hSet $ redis-
Pdo transactions
Pdo transactions
// Simple example of mysql transaction processing implemented by pdo
/*
Transactions that write multiple data entries to the database
Insert into test values ('test123',
Php paging class, first made
For the first time, let's step on
@ Charset "UTF-8 ";
* {Padding: 0; margin: 0 ;}
. Page {
Font-size: 14px;
Text-align: center
}
. Page ul {list-style-type: none; display:
Obtain the month date by week
Obtain the month date by week
/**
* Obtain the month date by week
* @ Param int $ weenNum week 0-6
* @ Return array $ days returns the date array.
*/
Public
Automatically recognize the Text Encoding and convert it to the target encoding!
When PHP processes the page, we use iconv or mb_convert functions for character set Conversion. However, this is actually a prerequisite. That is, we must know
PHP large log file read/write
The log file is large, with two or more GB log files. File operations are not supported. you can only read data by row.
Set_time_limit (0 );
@ Ini_set ('memory _ limit ', '64m ');
Php implements two-way cyclic queue-(implements functions such as forward and backward history records)
To enable the record operation history function
This function is similar to the undo or undo function. (Implement forward
KindEditor initialization parameters
FileManagerJson
Specifies the server program for browsing remote images. Data Type: String; default value: basePath + 'php/file_manager_json.php'
AllowPreviewEmoticons
Function that automatically detects the encoding in the content and performs conversion
// --- Example
$ Url = http://www.163.com ";
$ Data = file_get_contents ($ url );
$ Data = my_encoding ($
A small function that determines whether a string contains Chinese characters.
/*
It can be used for user names and other places where Chinese characters are not allowed
*/
// --
A function that determines whether it is a string within the specified length.
//
// Function name: CheckLengthBetween ($ C_char, $ I _len1, $ I _len2 = 100)
// For usage: determines whether the
Function for intercepting Chinese characters-csubstr
//----------------------------------------------------
// Function name: csubstr
// Used as a string. one Chinese character is counted as two
Introduction and examples of php Singleton mode
Private static $ _ instance;
2) constructor and clone functions must be declared as private to prevent external programs from losing the meaning of Singleton mode due to
Mybatis Database page
I began to love the interface-based method of mybatis.There are actually two changes (based on the demo on the official website ):
Added the paging plug-in, which is easy to use (feeling good ).
Add a
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