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 - PHP Tutorial
From the course: PHP Techniques: Working with Files and Directories
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
-
-
-
(Locked)
Filesystem basics6m 6s
-
Relative paths and magic constants4m 53s
-
(Locked)
Accessing files5m 4s
-
(Locked)
Reading from files4m 52s
-
(Locked)
Reading line by line5m 9s
-
(Locked)
File permissions5m 34s
-
(Locked)
Writing to files5m 5s
-
(Locked)
Writing line returns2m 28s
-
(Locked)
Deleting files2m 38s
-
(Locked)
Moving the file pointer7m 36s
-
(Locked)
Examining file details6m 52s
-
(Locked)
Challenge: Create a log file2m 2s
-
(Locked)
Solution: Create a log file3m 17s
-
(Locked)
-
-
-