Chapter 6. File Manipulation

Techniques You’ll Need to Master

  • How to open a file

  • How to read from a file

  • How to write to a file

  • How to close a file

  • How to interact with the filesystem

  • How to lock files

  • Miscellaneous functions for handling files

Terms You’ll Need to Understand

  • File resources

  • File properties

  • Advisory locking

  • End of File

Interacting with files is a constant aspect of programming. Whether they are cache files, data files, or configuration files, the ability to manipulate files and their contents is a core skill for PHP programmers. In this chapter, you will learn how to open file stream resources for reading from and writing to files, as well as filesystem-level functions for manipulating file attributes.

Opening Files

When interacting with ...

Get Zend PHP Certification Study Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.