Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The installation method of PHP Filesystem and the description of function

2025-01-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains the "PHP Filesystem installation method and function description", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "PHP Filesystem installation method and function description" bar!

Introduction to PHP Filesystem

The Filesystem function allows you to access and manipulate the file system.

Installation

The Filesystem function is part of the core of PHP. You do not need to install to use these functions.

Runtime configuration

The behavior of file system functions is affected by settings in php.ini.

File system configuration options:

The default description of the name can change allow_url_fopen "1"

This option activates the fopen encapsulation protocol in the form of URL so that URL objects such as files can be accessed. The default encapsulation protocol provides access to remote files using ftp and http protocols, and some extension libraries such as zlib may register more encapsulation protocols.

(PHP version 4.0.4 is available later. )

PHP_INI_SYSTEMuser_agentNULL

Defines the User-Agent sent by PHP.

(PHP version 4.3.0 is available later. )

PHP_INI_ALLdefault_socket_timeout "60"

The default timeout (in seconds) for socket-based streams.

(PHP version 4.3.0 is available later. )

PHP_INI_ALLfrom "" defines the password for anonymous ftp (your email address). PHP_INI_ALLauto_detect_line_endings "0"

When set to On, PHP checks whether the line end symbol in the data fetched through fgets () and file () conforms to Unix,MS-DOS or Macintosh custom.

This allows PHP to interoperate with the Macintosh system, but the default value is Off, because there is a small performance penalty when detecting the first line of EOL habits, and people who use carriage returns as item delimiters in Unix systems encounter downward incompatible behavior.

(PHP version 4.3.0 is available later. )

PHP_INI_ALLUnix / Windows compatibility

When the path is specified on the Unix platform, the forward slash (/) is used as the directory delimiter. On the Windows platform, both forward slash (/) and backslash (\) can be used.

PHP Filesystem function

PHP: indicates the earliest PHP version that supports this function.

The function describes the filename portion of the PHPbasename () return path. 3chgrp () changes the filegroup. 3chmod () changes the file mode. 3chown () changes the owner of the file. 3clearstatcache () clears the file state cache. 3copy () copies the file. 3delete () see unlink () or unset ().

Dirname () returns the directory name portion of the path. 3disk_free_space () returns the free space of the directory. 4disk_total_space () returns the total disk capacity of a directory. An alias for 4diskfreespace () disk_free_space (). 3fclose () closes the open file. 3feof () tests whether the file pointer reaches the end of the file. 3fflush () outputs buffered content to the open file. 4fgetc () returns characters from the open file. 3fgetcsv () parses a line from the open file and verifies the CSV field. 3fgets () returns a line from the open file. 3fgetss () reads a line from the open file and filters out the HTML and PHP tags. 3file () reads the file into an array. 3file_exists () checks whether a file or directory exists. 3file_get_contents () reads the file into a string. 4file_put_contents () writes the string to the file. 5fileatime () returns the last time the file was accessed. 3filectime () returns when the file was last changed. 3filegroup () returns the group ID of the file. 3fileinode () returns the inode number of the file. 3filemtime () returns when the file was last modified. User ID (owner) of the 3fileowner () file. 3fileperms () returns the permissions of the file. 3filesize () returns the file size. 3filetype () returns the file type. 3flock () locks or releases the file. 3fnmatch () matches the file name or string based on the specified pattern. 4fopen () opens a file or URL. 3fpassthru () reads the data from the open file up to EOF and buffers the write results to the output. 3fputcsv () formats the line as CSV and writes it to an open file. An alias for 5fputs () fwrite (). 3fread () reads the open file. 3fscanf () parses the input according to the specified format. 4fseek () locates in the open file. 3fstat () returns information about an open file. 4ftell () returns the read / write position of the file pointer 3ftruncate () truncates the file to the specified length. 4fwrite () writes to the file. 3glob () returns an array of file names / directories that match the specified pattern. 4is_dir () determines whether the specified file name is a directory. 3is_executable () determines whether the file is executable. 3is_file () determines whether the specified file is a regular file. 3is_link () determines whether the specified file is a connection. 3is_readable () determines whether the file is readable. 3is_uploaded_file () determines whether the file was uploaded through HTTP POST. 3is_writable () determines whether the file is writable. An alias for 4is_writeable () is_writable (). 3link () creates a hard connection. 3linkinfo () returns information about a hard connection. 3lstat () returns information about a file or symbolic link. 3mkdir () creates a directory. 3move_uploaded_file () moves the uploaded file to a new location. 4parse_ini_file () parses a configuration file. 4pathinfo () returns information about the file path. 4pclose () closes the process with popen () open. 3popen () opens a process. 3readfile () reads a file and outputs it to the output buffer. 3readlink () returns the target of the symbolic link. 3realpath () returns the absolute pathname. 4rename () renames the file or directory. 3rewind () reverses the location of the file pointer. 3rmdir () deletes the empty directory. 3set_file_buffer () sets the buffer size for open files. 3stat () returns information about the file. 3symlink () creates symbolic connections. 3tempnam () creates a unique temporary file. 3tmpfile () creates a temporary file. 3touch () sets the access and modification time of the file. 3umask () changes the file permissions of the file. 3unlink () deletes the file. 3PHP Filesystem constant

PHP: indicates the earliest PHP version that supports this constant.

Constant description PHPGLOB_BRACE

GLOB_ONLYDIR

GLOB_MARK

GLOB_NOSORT

GLOB_NOCHECK

GLOB_NOESCAPE

PATHINFO_DIRNAME

PATHINFO_BASENAME

PATHINFO_EXTENSION

FILE_USE_INCLUDE_PATH

FILE_APPEND

FILE_IGNORE_NEW_LINES

FILE_SKIP_EMPTY_LINES

Thank you for reading, the above is the "PHP Filesystem installation method and function description" content, after the study of this article, I believe you have a deeper understanding of the PHP Filesystem installation method and function description of this problem, the specific use also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report