PHP File System Functions
From w3cyberlearnings
# | Function | Description |
---|---|---|
1 | basename | Returns trailing name component of path |
2 | chgrp | Changes file group |
3 | chmod | Changes file mode |
4 | chown | Changes file owner |
5 | clearstatcache | Clears file status cache |
6 | copy | Copies file |
7 | delete | See unlink or unset |
8 | dirname | Returns parent directory's path |
9 | disk_free_space | Returns available space on filesystem or disk partition |
10 | disk_total_space | Returns the total size of a filesystem or disk partition |
11 | diskfreespace | Alias of disk_free_space |
12 | fclose | Closes an open file pointer |
13 | feof | Tests for end-of-file on a file pointer |
14 | fflush | Flushes the output to a file |
15 | fgetc | Gets character from file pointer |
16 | fgetcsv | Gets line from file pointer and parse for CSV fields |
17 | fgets | Gets line from file pointer |
18 | fgetss | Gets line from file pointer and strip HTML tags |
19 | file_exists | Checks whether a file or directory exists |
20 | file_get_contents | Reads entire file into a string |
21 | file_put_contents | Write a string to a file |
22 | file | Reads entire file into an array |
23 | fileatime | Gets last access time of file |
24 | filectime | Gets inode change time of file |
25 | filegroup | Gets file group |
26 | fileinode | Gets file inode |
27 | filemtime | Gets file modification time |
28 | fileowner | Gets file owner |
29 | fileperms | Gets file permissions |
30 | filesize | Gets file size |
31 | filetype | Gets file type |
32 | flock | Portable advisory file locking |
33 | fnmatch | Match filename against a pattern |
34 | fopen | Opens file or URL |
35 | fpassthru | Output all remaining data on a file pointer |
36 | fputcsv | Format line as CSV and write to file pointer |
37 | fputs | Alias of fwrite |
38 | fread | Binary-safe file read |
39 | fscanf | Parses input from a file according to a format |
40 | fseek | Seeks on a file pointer |
41 | fstat | Gets information about a file using an open file pointer |
42 | ftell | Returns the current position of the file read/write pointer |
43 | ftruncate | Truncates a file to a given length |
44 | fwrite | Binary-safe file write |
45 | glob | Find pathnames matching a pattern |
46 | is_dir | Tells whether the filename is a directory |
47 | is_executable | Tells whether the filename is executable |
48 | is_file | Tells whether the filename is a regular file |
49 | is_link | Tells whether the filename is a symbolic link |
50 | is_readable | Tells whether a file exists and is readable |
51 | is_uploaded_file | Tells whether the file was uploaded via HTTP POST |
52 | is_writable | Tells whether the filename is writable |
53 | is_writeable | Alias of is_writable |
54 | lchgrp | Changes group ownership of symlink |
55 | lchown | Changes user ownership of symlink |
56 | link | Create a hard link |
57 | linkinfo | Gets information about a link |
58 | lstat | Gives information about a file or symbolic link |
59 | mkdir | Makes directory |
60 | move_uploaded_file | Moves an uploaded file to a new location |
61 | parse_ini_file | Parse a configuration file |
62 | parse_ini_string | Parse a configuration string |
63 | pathinfo | Returns information about a file path |
64 | pclose | Closes process file pointer |
65 | popen | Opens process file pointer |
66 | readfile | Outputs a file |
67 | readlink | Returns the target of a symbolic link |
68 | realpath_cache_get | Get realpath cache entries |
69 | realpath_cache_size | Get realpath cache size |
70 | realpath | Returns canonicalized absolute pathname |
71 | rename | Renames a file or directory |
72 | rewind | Rewind the position of a file pointer |
73 | rmdir | Removes directory |
74 | set_file_buffer | Alias of stream_set_write_buffer |
75 | stat | Gives information about a file |
76 | symlink | Creates a symbolic link |
77 | tempnam | Create file with unique file name |
78 | tmpfile | Creates a temporary file |
79 | touch | Sets access and modification time of file |
80 | umask | Changes the current umask |
81 | unlink | Deletes a file |