Test your skills in PHP file handling by answering questions about reading, writing, opening, closing, and managing files effectively.
Question 2
What function is used to close an open file handle?
close()
fclose()
file_close()
end()
Question 3
How can you check if a file exists before opening it?
file_check()
exists()
file_exists()
is_file()
Question 6
How do you create a new directory in PHP?
mkdir()
makedir()
newdir()
create_folder()
Question 7
Which function lists files in a directory?
list_files()
scandir()
directory_list()
files_list()
Question 8
What function changes the permissions of a file?
chmod()
chperm()
fileperm()
setperm()
Question 9
How do you read a file line by line in PHP?
Using fgets()
or fgetcsv()
inside a loop
Using file_get_contents()
Using readfile()
Using readline()
Question 10
Which function returns the file extension of a file?
file_extension()
pathinfo()
ext()
get_extension()
There are 10 questions to complete.