If you use substr to intercept the Chinese string will certainly be garbled, because he will divide a Chinese character into half, why so, because of the problem of internal coding of the machine, now we look at the processing method
1, the use of
The Linux shell/terminal command is very powerful, even though a simple command can cause folders, files, or path folders to be deleted.
In some cases, Linux does not even ask you to execute commands directly, causing you to lose a variety of data
query ("SHOW CREATE TABLE $table"); $create = $db->fetch_row ($createtable); $tabledump. = $create [1]. "; N\n "; return $tabledump; /****** back up the database structure and all data ******//* Function name: Data2sql ()
Title: Generate 0-9 random number, requires 0 to 9 the probability of occurrence descending,
General idea, put 10 0, 9 1, 8 2 ..... 2 8, a 9 in the array, then randomly generate an array subscript, press the subscript to take out the
The following ideas are implemented:
1. Set the camera background, such as the use of red cloth or blue, etc., white walls can also.
2. Select HD camera, such as Logitech and other high-definition cameras, the higher the resolution, the better.
3.
The article has two instances is used to detect the upload file type and upload image size, I would like to write separately but feel that two will be better Together, the students need to see.
Function name: Checkextendname ($C _filename, $A
This tutorial is about calling and function definition syntax for functions, and about variables in functions and passing numerical methods to functions.
First, the basis of the function
PHP provides a number of functions, and allows the user to
PHP is a weakly typed language when using the In_array function as much as possible with the third parameter, the code is as follows:
Var_dump (In_array (0,array (' s ', ' SSS '), true)); return False
Var_dump (In_array (0,array (' s ', ' SSS ')
PHP has out-of-the-box function getimagesize to get the dimensions of the image, the specific function usage, and the code example:
/* 1.jpg you want to get a picture of its size * *
$arr = getimagesize ("1.jpg");
/**
* Here $arr for an array
Utf-8 format text in the string interception is prone to a section of the case, and prone to garbled, this is a relatively simple function, requires PHP to open the mbstring extension
$text is the text to be intercepted, $length is the length of
When we use the TEXTAREA will find the carriage return and the space is not visible, so we use the Str_replace function to replace the PHP \\n into a BR can be, the need for friends can refer to the code as follows:
function Htmtocode ($content) {
Date_default_timezone_set (' PRC ');
/**
* To find a date after a certain number of days from a certain date,
* Exclude Saturday Sundays and holidays
* @param $start Start date
* @param $offset days Elapsed
* @param $exception exceptions for
The first two days studied MediaWiki.
Involves the user's password encryption, found in the source code encryption method is as follows:
In the globalfunctions.php:
/*** Encrypt a Username/password.** @param string $userid ID of the user* @param
One, gets the UNIX timestamp for the specified date
Strtotime ("2009-1-22") examples are as follows:
1.echo strtotime ("2009-1-22")
Results: 1232553600
Description: Return January 22, 2009 0:0 0 seconds timestamp
Second, get the English text date
CentOS installed good apache,mysql and other server programs, and did not set up automatically start the boot, to avoid restarting the web and other servers to manually open, or to do the following settings, in fact, the settings are very simple,
Because PHP does not require strict syntax, strings can also be used when arrays, so there is a problem: when using non-numeric as key to access the contents of the string, there may be some inconsistencies, such as the following code
1 $hello =
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