Correct:
--> fgetss($fp);
--> fgets($fp);
Explanation:
Answer options A and B are correct.
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.
The fgets()
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.
Answer options C and D are incorrect. The fread()
function is used to read from an open file. It stops at the end of the file or when it reaches the specified length, whichever comes first. The syntax of the fread
function is as follows:
string fread (resource $handle, int $length)
The fread()
function reads up to 'length' bytes from the file pointer referenced by 'handle'.
Reference: https://www.php.net/manual/en/function.fgetss.php