Answer & Solution
dirname() function returns the parent directory of a file path, such as extracting '/path/to' from '/path/to/file.txt'.
dirname() function returns the parent directory of a file path, such as extracting '/path/to' from '/path/to/file.txt'.
Which PHP function checks if a file or directory exists?
A). file_exists()
B). is_file()
C). exists()
D). check_file()
Which superglobal variable in PHP is used to handle file uploads?
A). $_FILES
B). $_POST
C). $_GET
D). $_REQUEST
Which PHP function sets the default permissions for new files?
A). umask()
B). chmod()
C). set_permissions()
D). default_perms()
Which PHP function sets the file pointer to the beginning of a file?
A). rewind()
B). reset()
C). fseek()
D). file_start()
Which PHP function is used to change file permissions?
A). chmod()
B). chown()
C). chgrp()
D). umask()
Which PHP function is used to handle file uploads?
A). move_uploaded_file()
B). copy()
C). rename()
D). fopen()
What PHP function is used to delete a file?
A). unlink()
B). remove()
C). delete()
D). file_delete()
Which PHP function returns the size of a file?
A). filesize()
B). get_filesize()
C). file_size()
D). size()
What PHP function retrieves information about a file?
A). stat()
B). fileinfo()
C). fileinfo_stat()
D). fileinfo()
What attribute is required in HTML forms for file uploads?
A). enctype='multipart/form-data'
B). method='file'
C). enctype='application/x-www-form-urlencoded'
D). enctype='text/plain'