My own php date capturing
My own php date capturing
Echo j7_getdate ('Y-m-D', '2017-11-15 ',' + 10 Day ');
Function j7_getdate ($ format, $ time = 'Now ', $ opt ){
Return date ("$ format", strtotime ("
Use php to compare the similarities and differences between the two folders
Requirement: you can only use command lines to compare the differences between two folders, including the differences between files.Thinking: Although there is diff
Returns a random string.
Returns a random string.
/*
Purpose: obtain a random string.
Parameters:
1. (int) $ length = 32 # random character length. the default value is 32.
2. (int) $ mode = 0 # random
Share A Chinese verification code again
Share A Chinese verification code
/*
For more information, see ITBBS.
Modify contact author mailbox: Smartly@itbbs.cn
*/
Header ("Content-type: image/PNG ");
$
Share a piece of collection program code
I can see that some people always ask curl questions. I have nothing to do with a small program to collect the Forum in the past two days. It includes simulated login, page source code retrieval,
Double-byte character truncation
Double-byte truncation, such as truncation of Chinese characters and English-mixed texts
Function substr ($ string, $ length)
{
$ I = 0;
$ J = 0;
While ($ I
Method 4: traverse all files and folders in a folder
Traverse all files and folders in a folder
Function list_dir ($ dirpath ){
If ($ dirpath [strlen ($ dirpath)-1]! = "\") {$ Dirpath. = "\\";}
Static $ result_array =
Determines whether the input is a pure number, English or Chinese character.
Using the mb_strlen and strlen functions of php, you can easily know whether the string is composed of English letters, English letters and Chinese characters, or
Learn how to use phpserialize () and unserialize ()
The explanations of serialize () and unserialize () in the php Manual are: serialize-Generates a storable representation of a valueserialize-generate a representation of the stored
PHPheader () function usage
Note: No matter how many headers are on the page, it executes the last one, but it is conditional. for example:
Header ('Location: http://bbs.it-home.org ');
Header ('Location:
Use php to obtain table field information
To obtain field information in php, you can use the followingFunction: Mysql_fetch_field () mysql_num_fields () mysql_list_fields () mysql_field_flags () mysql_field_len () mysql_field_name () mysql_
Example of PHP file traversal
Example of PHP file traversalComplete code:
$ Dir = "D: \ workspace ";
Function list_file ($ dir = '.'){
$ List = scandir ($ dir );
Echo'
';
Detailed description of php reading and splitting large file instances
Php reads and separates large filesIn php, the quickest way to read files is to use functions such as file, file_get_contents, and a few lines of code. However, when the
Php file download instance code
If you use php to implement forced file download, the header function is usually used. Example: PHP file download instance.
Class Downfile {
Function downserver ($ file_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