How can you differentiate between a 'directory' and a 'file' using PHP functions?
- is_dir() checks for directory
- file_exists() checks for a file
- scandir() lists the directory's contents
- is_file() checks for a file
The is_dir() function in PHP is used to determine if a given path is a directory. It's a key function for distinguishing directories from files.
Loading...
Related Quiz
- Which of the following are common uses of indexed arrays in PHP?
- Which PHP loop will execute a block of code at least once, then it will repeat the loop as long as the condition is true?
- Which of the following is a common best practice when writing PHP functions?
- PHP supports eight primitive data types.
- After installing PHP, you need to restart the ______ to make sure the changes take effect.