Difference between revisions of "PHP/file/io"
Jump to navigation
Jump to search
Line 3: | Line 3: | ||
* [https://www.php.net/manual/en/ref.filesystem.php Filesystem Functions] | * [https://www.php.net/manual/en/ref.filesystem.php Filesystem Functions] | ||
** <code>[https://www.php.net/manual/en/function.fgetcsv fgetcsv()]</code> | ** <code>[https://www.php.net/manual/en/function.fgetcsv fgetcsv()]</code> | ||
+ | ** <code>[https://www.php.net/manual/en/function.fgets fgets()]</code>: read a line from a file-handle | ||
** <code>[https://www.php.net/manual/en/function.file-get-contents file_get_contents()]</code> | ** <code>[https://www.php.net/manual/en/function.file-get-contents file_get_contents()]</code> | ||
** <code>[https://www.php.net/manual/en/function.file-put-contents file_put_contents()]</code> | ** <code>[https://www.php.net/manual/en/function.file-put-contents file_put_contents()]</code> | ||
+ | ** <code>[https://www.php.net/manual/en/function.fopen fopen()]</code>: open handle to file | ||
+ | ** <code>[https://www.php.net/manual/en/function.fputcsv fputcsv()]</code>: write a line in [[CSV]] format | ||
+ | ** <code>[https://www.php.net/manual/en/function.fread.php fread()]</code>: binary-safe read from a file-handle | ||
+ | ** <code>[https://www.php.net/manual/en/function.fwrite fwrite()]</code>: binary-safe write to file-handle | ||
* [https://www.php.net/manual/en/refs.fileprocess.file.php File System Related Extensions] | * [https://www.php.net/manual/en/refs.fileprocess.file.php File System Related Extensions] |
Revision as of 14:01, 21 March 2020
This is a quick index to information about accessing files in PHP.
Functions
- Filesystem Functions
fgetcsv()
fgets()
: read a line from a file-handlefile_get_contents()
file_put_contents()
fopen()
: open handle to filefputcsv()
: write a line in CSV formatfread()
: binary-safe read from a file-handlefwrite()
: binary-safe write to file-handle
- File System Related Extensions