PHP - File HandlingWhich PHP function checks if a file or directory exists at a given path?Afilesize()Bis_file()Cfile_exists()Dis_readable()Check Answer
Step-by-Step SolutionSolution:Step 1: Understand the purpose of file_exists()The function file_exists() returns true if the file or directory exists at the specified path.Step 2: Compare with other functionsFunctions like is_file() check if the path is a file, filesize() returns size, and is_readable() checks permissions, but none check existence alone.Final Answer:file_exists() -> Option CQuick Check:Check existence = file_exists() [OK]Quick Trick: Use file_exists() to check any file or directory presence [OK]Common Mistakes:Confusing is_file() with existence checkUsing filesize() to check existenceAssuming is_readable() means file exists
Master "File Handling" in PHP9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PHP Quizzes Array Functions - Array filter function - Quiz 12easy Classes and Objects - Methods and $this keyword - Quiz 6medium Error and Exception Handling - Try-catch execution flow - Quiz 15hard Error and Exception Handling - Multiple catch blocks - Quiz 8hard Interfaces and Traits - Multiple interface implementation - Quiz 12easy Sessions and Cookies - Starting and using sessions - Quiz 1easy Sessions and Cookies - How cookies work - Quiz 8hard Sessions and Cookies - Session vs cookie decision - Quiz 1easy Sessions and Cookies - Session variables - Quiz 8hard Superglobals and Web Context - Form handling execution flow - Quiz 2easy