Files

Learn how to work with files in PHP and how to avoid common file-related pitfalls.

It’s time to look at long-term data stores. The most obvious one is the file system. The logic is simple—if we need to save some data, we put it into a file. That’s what computers do.

Working with files isn’t popular in web applications, but it remains a powerful tool for storing data and passing it between applications.

Using files in PHP

PHP offers many functions for working with files. The complete list is in the PHP Manual.

Here’s a list of the most commonly used functions.

Single operation functions

...
Access this course and 1400+ top-rated courses and projects.