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 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
Returns a small function with a Chinese character length.
// The length of a Chinese character. the length of a Chinese character is 1.
Function cstrlen ($ str ){
$ N = 0; $ p = 0; $ c = ";
Questions about session in php
For questions about session in php, please read this article carefully and I believe you will gain some benefits.For questions about session in php, please read this article carefully and I believe you will
PHP remote image save to local
Simple File operations, remote image storage local.
Function get_file ($ url, $ folder, $ pic_name ){
Set_time_limit (24*60*60); // you can specify the maximum execution time.
$
Php program for mass mailing by reading text
// Request the PHPmailer class file
Require_once ("class. phpmailer. php ");
// Email sending function
Function smtp_mail ($ sendto_email,
Specify the small function of the message through the JS prompt on the page.
/*
* Function: specify a message through the JS prompt on the page and end the page execution.
* Parameters:
* Msg: The
Php code that separates large numbers with delimiters
// Floating point is not considered
/*
* Method 1
* Echo number_format ($ str, 2 ,'.',',');
*/
/* Method2
* First reverse the string
A question about Loop quits in php
// The Current php loop is 1, and the loop increases sequentially from the inside to the outside. the default break is 1, for example, jumping out of the 2nd-layer
Php string determination and deletion of variables
$ A = '11 ';
$ B = 11;
If ($ a ===$ B)
{
Echo 'Strictly equal ';
}
Else if ($ a = $ B)
{
Echo 'Equality ';
}
Else
Passport encryption function written in php
/**
* Passport encryption function
*
* @ Param string the original string waiting for encryption
* @ Param string private key (used for
Strtotime function efficiency in php
$ Start = array_sum (explode ('', microtime ()));
For ($ I = 0; $ I
Strtotime ("-1 day ");
}
$ End = array_sum (explode ('', microtime ()));
A function used to calculate the runtime of a php page
/*
Calculate the php program running time
*/
Function microtime_float ()
{
List ($ usec, $ sec) = explode ("",
Example of calculating the execution time of the current page in php
// Do something
Sleep (3 );
// Do something
$ Running_time = time ()-$ _ SERVER ['request _ time'];
Echo 'Page
Detailed description of the autoload mechanism in php
/* Person. class. php */
Class Person {
Public $ name;
Public $ age;
Function _ construct ($ name, $ age)
{
$ This-> name = $
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