1. Home
  2. Computer Science MCQs
  3. PHP
  4. Which function do you have to use to check whether the…

Added 19 Jan 2024

Which function do you have to use to check whether the $path you’ve stored exists?

  1. path_dir()
  2. path()
  3. is_dir() Correct answer
  4. path_dir()

Correct answer

C. is_dir()

13 views

MCQSEXAM

Explanation

The is_dir() function checks whether the given path exists and is a directory. file_exists() also tests existence, but among the options is_dir() is the correct one.

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More PHP MCQs

Practise all PHP MCQs

Similar MCQs