This course teaches how to use PHP to work with files and directories.
Overview
Syllabus
Introduction
- Work with files and directories in PHP
- Using the exercise files on GitHub
- Filesystem basics
- Relative paths and magic constants
- Accessing files
- Reading from files
- Reading line by line
- File permissions
- Writing to files
- Writing line returns
- Deleting files
- Moving the file pointer
- Examining file details
- Challenge: Create a log file
- Solution: Create a log file
- Directory basics
- Creating and deleting directories
- Accessing directory contents
- Skipping directory entries
- Pattern matching with glob
- Challenge: Directory treasure hunt
- Solution: Directory treasure hunt
- Configuring PHP for file uploads
- Sending files as form data
- Inspecting uploaded files
- Moving uploaded files
- Handling upload errors
- Setting file permissions
- Securing file uploads
- Challenge: Profile photo
- Solution: Profile photos
- Next steps
Taught by
Kevin Skoglund