PHP file processing directory and file processing

Source: Internet
Author: User

mkdir () Create a new directory

RmDir () Delete an empty directory, if there are files in the directory, delete the files in the directory first

GETCWD () Get current working directory

ChDir () sets the current directory as the working directory

' @ ' suppresses the wrong character

Opendir () Open a directory handle

Readdir () reading directory contents

Scandir () lists all directories and files under the specified file

fopen () Open file------http://www.w3school.com.cn/php/func_filesystem_fopen.asp

Fclose () Close file

Fwrite () write

File_put_contents () with fopen (), fwrite (), fclose () effect can be used directly (write)

The Fputcsv () function formats the row as CSV and writes an open file. The function returns the length of the write String. If an error occurs, False is returned:

Fread () read file two parameters (1. File name, 2. Location of the end);

Feof () read the file a parameter passed in a filename, automatically read to the end of the file, successfully returned a true, failed to return a false

File () reads the entire file into an array, note: Files cannot be too large

ReadFile () reads a file on the browser output

The Fpassthru () function reads all data from the current position of the open file until the end of the file (EOF) and writes the result to the output buffer.

The function returns the number of characters passed, or FALSE if it fails.

File_get_contents () with fopen (), Fread (), fclose () effect can be used directly (read)

Fgets () reads a line

FGETSS () also reads a line, but removes any HTML and PHP markup

Fgetcsv () (a file with a. csv suffix) reads the row formatted as CSV

Fgets () reads a character

FSCANF () reads data from a file and can be formatted according to the specified format

PHP file processing directory and file processing

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.