From the course: PHP Techniques: Working with Files and Directories

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Examining file details

Examining file details - PHP Tutorial

From the course: PHP Techniques: Working with Files and Directories

Start my 1-month free trial

Examining file details

- [Instructor] In this movie, we'll learn what PHP can tell us about various details of files. We've already seen a few PHP functions. We learn about filesize, is_file, and is_dir. To this we can add is_readable, is_writable, and is_executable. Those take a file path as an argument. They'd first make sure the file exists, and then they return true or false based on whether PHP has permission to read, write, or execute the file. Before you try to write to a file, you can check to see if that's allowed. And if not, you can handle it in your PHP code gracefully. We can also examine file times using filemtime, filectime, and fileatime. Mtime is the last modified time. The last time that content was changed. Ctime is the last change time which is the last time that content or metadata about the file was changed. It is not created at time as some beginners often believe. Atime is the last access time. The last time…

Contents