K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function checks if a path is a directory? (A) is_dir() (B) is_folder() (C) dir_exists() (D) folder_check() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (A) is_dir() Explanation: is_dir() checks whether the path is a directory.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function reads the entire file into a string? (A) file() (B) fread() (C) readfile() (D) file_get_contents() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (D) file_get_contents() Explanation: file_get_contents() reads file content into a string.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function writes data to a file? (A) write_file() (B) file_write() (C) file_put_contents() (D) fwrite_all() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) file_put_contents() Explanation: file_put_contents() writes data to a file.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function deletes a file? (A) delete() (B) remove() (C) unlink() (D) erase() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) unlink() Explanation: unlink() deletes a file.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function creates a directory? (A) dir_create() (B) make_dir() (C) mkdir() (D) create_folder() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) mkdir() Explanation: mkdir() creates a directory.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function removes a directory? (A) remove_dir() (B) delete_dir() (C) rmdir() (D) unlink_dir() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (C) rmdir() Explanation: rmdir() deletes an empty directory.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function retrieves environment variables? (A) env() (B) getenv() (C) $_ENV (D) Both getenv() and $_ENV 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (D) Both getenv() and $_ENV Explanation: Environment variables can be accessed using getenv() or $_ENV.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP superglobal stores server and execution environment info? (A) $_ENV (B) $_SERVER (C) $_SESSION (D) $_REQUEST 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) $_SERVER Explanation: $_SERVER contains server and execution details.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function gets the current working directory? (A) pwd() (B) getcwd() (C) current_dir() (D) cwd() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) getcwd() Explanation: getcwd() returns the current working directory.
K Kanak Sharma 🎓 Tutor III ⭐ 6.13K Points 📊 PHP Q. Which PHP function changes the current directory? (A) setcwd() (B) chdir() (C) cd() (D) change_dir() 👁️ Show Answer 💬 Discuss 🔗 Share ✅ Correct Answer: (B) chdir() Explanation: chdir() changes the current directory.