Home >> FAQs/Tutorials >> PHP Script Tutorials and Tips >> Index

PHP Tutorials - Reading and Writing Files

By: FYICenter.com

A collection of 14 tips on PHP functions on file input and output. Clear answers are provided with tutorial exercises on opening files for reading and writing, appending data to existing files, reading file by line or character, reading file in binary mode. Topics included in this collection are:

  1. How To Read a Text File into an Array?
  2. How To Read the Entire File into a Single String?
  3. How To Open a File for Reading?
  4. How To Open a File for Writing?
  5. How To Append New Data to the End of a File?
  6. How To Read One Line of Text from a File?
  7. How To Read One Character from a File?
  8. What's Wrong with "while ($c=fgetc($f)) {}"?
  9. How To Read a File in Binary Mode?
  10. How To Write a String to a File with a File Handle?
  11. How To Write a String to a File without a File Handle?
  12. How To Write an Array to a File without a File Handle?
  13. How To Read Data from Keyboard (Standard Input)?
  14. How To Open Standard Output as a File Handle?

(Continued on next topic...)


Selected Developer Jobs:

More...