Php traverses folders and implements code editing and deletion.
/*
Function: (a) delete a file (B) edit a file, and delete a folder on a webpage (c), provided that the folder is empty (d) create a file or folder,
Php function for obtaining the folder size
// Get the folder size
Function getDirSize ($ dir)
{
$ Handle = opendir ($ dir );
While (false! ==( $ FolderOrFile = readdir ($ handle )))
{
If
Example of phpheader function usage (2)
Header ("Location: http://www.php.net ";);
Exit; // after each redirection, you must add "exit" to avoid errors and continue execution.
?>
Header
Php implementation code for exporting CSV files
// Note that the correct class path is included
Require_once (dirname (_ FILE _). '/export. php ');
$ Exceler = newJason_Excel_Export ();
//
The differences between time (), date (), and mktime () in php
Print (date ("l dS of f y h: I: s "));
Print ("July 1, 2000 is on a". date ("l", mktime )));
?>
Example 2:
$
Small example of phpmcrypt encryption and decryption
/**
* Mcrypt encryption and decryption
* By bbs.it-home.org
*/
$ Data = 'data ';
$ Key = "key ";
$ Algorithm = MCRYPT_BLOWFISH;
Usage of the php function spl_autoload_register
Class {
Public function _ construct (){
Echo 'Got it .';
}
}
Then, there is an index. php that needs to use class A. The General syntax
How to write files in php
This article describes how to write files in php programming. if you need it, you can learn it.In php, the following steps are generally taken to write a File: 1. First, determine the content of the file to be
Usage of mysql_fetch_array () function in php
This article describes the usage of the mysql_fetch_array () function in php. it returns the data query results in the form of arrays. For more information, see.Php Data Query result function:
Php intercepts the code of a specified length string
Share a function to intercept a specified length string. you can specify the length of the string to intercept and set the display content beyond the specified length. This function is
Implementation code of apc and file cache classes in php
Class CacheException extends Exception {}
/**
* Cache abstract class
*/
Abstract class Cache_Abstract {
/**
* Read cache
Measure the test taker's understanding about php multithreading.
This article introduces how to use multiple threads in php in a linux environment. For more information, see.The php multithreading knowledge shared in this section requires
Php multi-thread code sharing
This article introduces a class for implementing multithreading in php. For more information, see.How does one implement the multi-thread function of PHP through the WEB server? In php programming,
Php code sharing for searching and replacing the http address in a string
This article describes how to use php to search for the http address in the specified string and replace the code. For more information, see.Search for and replace
Php shows the implementation code just a few minutes ago by time
This article describes how to use php to determine based on time to display the code just a few minutes ago and a few hours ago. For more information, see.Determine the time
Differences between include and require in PHP
If ($ something ){
Include ("somefile ");
}
Example 2: no matter what value $ something takes, the file somefile will be included in the file:
If
Php function ob_start () for browser cache control
Ob_start (); // open the buffer
Echo \ "Hellon \"; // output
Header ("location: index. php"); // redirects the browser to index. php.
Ob_end_flush ();
Example of phpsqlite_create_function
/**
* Sqlite_create_function example
* Edit: bbs.it-home.org
*/
Define ("PPO", 400 );
Function my ($ salary ){
Return $ salary/PPO;
}
Example of PHPheader function usage
Header ("Location: http://bbs.it-home.org ";);
Exit; // after each redirection, you must add "exit" to avoid errors and continue execution.
?>
Header
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