Here are a few functions for you to reference.
Example one:
Copy Code code as follows:
function Deletedir ($dir) {
if (!handle= @opendir ($dir)) {//detect if the directory you want to open is present
Die ("No such catalogue");
}
?
/***********************************************************************************/
/*/ /*/
/*/program:file System Class (FSC)/*/
/*/PHP programer: Wu Di (James Wu)/*/
Childprocess
Because when I translateNodeOfAPIA lot of changes have been made, so here is the changed content.
NodeInChildprocessProvides a three-wayPopen (3)Methods, they areStdin, stdout, stderrThey all use the stream data format with
Delete files and directories in PHP rmdir () function can be done, but to delete a non-empty directory, will not be able to quickly delete, you must first delete the directory files, but there may be subdirectories in the directory, so you want to
? Php
$ file = ' Dirlist. PHP ';
$ result = @unlink ($file);
if ($result = = False) {
Echo ' Mosquitoes have driven away ';
} else {
Echo ' cannot be driven away ';
}
?>
Can.
It is also easy for PHP to delete the
In PHP we want to delete a specified file we can use the unlink function to implement, below I give you detailed description of the unlink function to delete a specified file of the specific method, there is a need to know the friend can refer
Here are a few function references for you.
Example one:
Copy the Code code as follows:
function Deletedir ($dir) {if (!handle= @opendir ($dir)) {//detects if the directory to open existsDie ("No such directory");}while (False!== ($file =readdir
Below I have added three php files to my favorites. He can use unlink to delete any files that can be deleted. This program wants to delete files, images, and compressed files. We have used several methods for example.
Below I have added three to my
Php checks whether a file exists. Php is very easy to determine whether a file exists in php. you only need a function: file_exists (file path). This function is generally used to determine whether a file exists, however, it is very easy for php to
The constructor is directly used here. considering that there will be many static page generation processes, instead of function calls, this part will be retained. in the class, replace template () with templateHtml () to achieve this, * nbsp...
The
/**
* Func:delete_file
* Params: $file file name
* Multiple criteria to determine the deletion of files
* by bbs.it-home.org
*/
function Delete_file ($file)
{
if (file_exists ($file))
{
$delete =
PHP multiple judgment file deletion function code
/**
* Func: delete_file
* Params: $ file name
* Multiple criteria are used to determine whether to delete an object.
* By bbs.it-home.org
*/
In the Internet cafes to look at the time, due to the presence of the movie in the page search function (user input)
This function because can not be made static, then only can be dynamic, with the dynamic time to the database, server pressure
Questions about sending emails using the phpmailer class. [Size = 12px] the phpmailer class has a CreateBody () method. the [/size] code is as follows: & nbsp;/** & nbsp; * Assemblesthemessagebody. returnsanemptystringo sends emails using the
In php, we can use the unlink function to delete a specified file. The following describes how to delete a specified file by the unlink function, for more information, see.
The unlink () function deletes a file.
If the call succeeds, true is
When looking at the Internet cafe, the movie search function (user input) exists in the page)
This function cannot be made static, so it can only be dynamic. When dynamic, it will bring a great test to the database and server pressure.
Therefore,
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.