PHP skills: file system function library in PHP script programming

Source: Internet
Author: User
Basename: returns a file string without a path. Chgrp: group to which the conversion file belongs. Chmod: convert the attributes of a file. Chown: The owner of the transformation file. Clearstatcache: clears the file status cache. Copy: copy an object. Delete: Useless Project

Basename: returns a file string without a path.
Chgrp: group to which the conversion file belongs.
Chmod: convert the attributes of a file.
Chown: The owner of the transformation file.
Clearstatcache: clears the file status cache.
Copy: copy an object.
Delete: useless project.
Dirname: Get the directory name in the path.
Diskfreespace: obtain the available space of the Directory.
Fclose: Closes opened files.
Feof: indicates whether the file pointer is at the end of the file.
Fgetc: get the character referred to by the file pointer.
Fgetcsv: retrieves the row indicated by the file pointer and parses the csv field.
Fgets: Get the row indicated by the object pointer.
Fgetss: Gets the row indicated by the file pointer and marks it in the html language.
File: Read all files into array variables.
File_exists: Check whether the file exists.
Fileatime: The last time the file was accessed.
Filectime: Get the Last transformation time of the file.
Filegroup: the group to which the file belongs.
Fileinode: Get the inode value of the file.
Filemtime: The Last correction time of the file.
Fileowner: obtains the object owner.
Fileperms: get the file permission configuration.
Filesize: get the file size.
Filetype: obtain the file type.
Flock: lock a file.
Fopen: open a file or url.
Fpassthru: output all remaining materials.
Fputs: writes the file pointer.
Fread: the bit group method to read files.
Fseek: move the file pointer.
Ftell: get the file read/write pointer status.
Fwrite: The binary bit method is used to write data into the file.
Set_file_buffer: configure the file buffer size.
Is_dir: test whether the file is a directory.
Is_executable: whether the test file is executable.
Is_file: test whether the file is a normal file.
Is_link: test whether the file is a link file.
Is_readable: test whether the file can be read.
Is_writeable: test whether the file can be written.
Link: create a hard link.
Linkinfo: Gets the link information.
Mkdir: create a directory.
Pclose: closed file.
Popen: open the file.
Readfile: output file.
Readlink: The target file of the symbolic link.
Rename: change the file name.
Rewind: resets the read/write status pointer of an open file.
Rmdir: delete the directory.
Stat: get the file information.
Lstat: get the link information.
Symlink: creates a symbolic link ).
Tempnam: create only one temporary file.
Touch: configure the last correction time.
Umask: transform the current file attribute mask umask.
Unlink: delete an object.


Basename
Returns a file string without a path.
Syntax: string basename (string path );
Return value: string
Function type: file access

Description: remove the path containing the path and the file string, and return a string containing only the file name. In the windows Control system, the path can be a slash (/) or a backslash (\). in the unix control system, the path is a slash (/).

Application model
In the following example, the value of the $ file variable is 'index. php'
$ Path = '/home/httpd/html/index. php ';
$ File = basename ($ path );
?>
See dirname ()

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.