PHP File Handling

  1. When the underlying system supports advisory locking, flock, while not completely atomic, will still be safe for most applications.
  2. Determining the Document Root, also known as the Base Path, is important when you want to include files or work with the file system; this solution should be very flexible and broadly compatible.
  3. How to get a list of included files and know if a certain file was included by PHP.
  4. Tutorial on how to use PHPs include, include_once and require.
  5. Are the bare file- functions in PHP safe to use?
  6. In this tutorial I show how to create a simple_delete() function in PHP to automatically delete whatever you ask it, and also handle errors.
  7. How to do disk operations, such as creating and deleting files, in PHP.
  8. I needed a script to quickly rename all files in a directory, so I came up with this elegant PHP solution.