Explanation:
Answer option A is correct.
In the above script, the fseek()
function is moving the file pointer to the start of the file. The rewind()
function works in the same manner and moves the current cursor position to the start of the file.
Answer option B is incorrect. The fgets()
PHP function is a file handling function that is used to retrieve data from an open file. The syntax of the fgets()
function is as follows:
fgets(file, length);
where the file parameter is the name of the file to be retrieved and length is the number of bytes to read. The default is 1024 bytes.
Answer option C is incorrect. The fgetss()
function is used to retrieve data that does not contain any HTML or PHP tag from a file . The syntax of the fgetss()
function is as follows:
fgetss(file, length, tags);
where the file parameter specifies the file to be checked, length specifies the number of bytes to read, and tags specifies the HTML/PHP tags that will not be removed.
Answer option D is incorrect. The file() function is used to read the entire file into an array. A user can also use a URL as a filename with this function if the fopen wrappers have been enabled. Since the file() function reads and parses the entire file, this function can be expensive if used on large files. For larger files, a user should use the fopen() function and iterate over it line by line with the fgets() function to achieve a similar result.
Reference: http://www.php.net/manual/en/function.rewind.php