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 and then perform operations, commonly used File Deletion: unlink (file
*/ The code is as follows:Copy code Class upfile {// Upload file informationVar $ filename;// Save the nameVar $ savename;// Save pathVar $ savepath;// The file format is limited. If it is null, the format is not limited.Var $ format = "";//
Issues related to sending messages with the Phpmailer class.
[size=12px] has a createbody () method in the Phpmailer class, [/size]
The code is as follows:
/**
* Assembles the message body. Returns an empty string on failure.
* @access Public
*
deleting files
Use the Unlinke function, such as unlink $file, unlink $file 1, $file 2, $file 3
Open File
Opening the file in the form of three parameters makes it easy to differentiate between the schema and the file name, which is supported by
The most common use of Perl is file processing, and here's a summary of some of the things that Perl files do, and a concrete example that reinforces our understanding of Perl file operations with the example below.
deleting files
Use the Unlinke
Look at yourself:[Email protected] ~]#RM--Help usage: RM [options] ... File... Delete (unlink) file. -F,--force removal. Ignore files that do not exist, do not prompt for confirmation-I need to confirm before deleting-I ask for confirmation
I often see people on the Internet to ask how the entire dynamic Web site static, in fact, the implementation of the method is very simple.
The code is as follows
Copy Code
Add Ob_start () at the beginning of your
Some functions are not added, such as automatic renaming, image processing and so on. Can be added as needed.Use:$up = new Upfile (root_path. ' data/'. Date ("Ym", Time ()), array (' gif ', ' jpg ', ' jpeg '), true);$fileimg = $up->upload
Here the implementation of the PHP Import export Excel function is to use open source Phpexcel, do the following operation please download the class library file, the official website: http://www.codeplex.com/PHPExcel, website case code a lot,
The code is as follows:
Copy Code code as follows:
/***************************************************************************
Batch-replace, v1.1
***************************************************************************
1. When chomp without parameters, the default parameters are used and the $_ operation is done.
2. Array @array ... Available $array[number] references. $ #array. Represents the number of indexes in an array.
3. $! contains error messages;
4. The
Link: https://share.weiyun.com/6b98e41d036967178e1a21fb88ed340f (password: ynny)File name Error injectionindex.php?m=member&a=upfiles&id=2Xercms\modules\member\index.php in this folderRegistered users at the front desk grab a bag at the Avatar
1、fopen() fwrite() fclose() fiel_put_contents1) fopen (path,′xx′) Open a file xx=r read-only open and point the pointer to the head xx=r+ read-write mode to open xx=w write, and empty the contents of the file, the pointer executes the head, does not
Z.asp
Copy Code code as follows:
s= Server.MapPath ("z.asp")
Set fso = CreateObject ("Scripting.FileSystemObject")
If FSO. FileExists (s) Then
Fso. DeleteFile (s)
End If
Set FSO = Nothing
%>
z.php
Copy Code
Oh, suddenly a friend asked me how to delete the directory, such as the following files, I said with a pass, he said too slow. So we summed up the following methods.
1. Recursive method://I provide, it seems a bit wrong, no test
Deletedir ($dir)
{
Send a simple example first
Copy Code code as follows:
if (!is_dir (' txt '))//Determine if TXT is a folder directory
{
mkdir (' txt ');//Create a folder directory named txt
$open =fopen (' txt/in.txt ', ' w+ ');//Open file in
One: Catalog operations
The first is a function read from the directory, Opendir (), Readdir (), Closedir (), which is used to open the file handle first and then iterate over the following list:
Copy Code code as follows:
$base
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.