Explanation:
Answer option C is correct.
You will use the fgetss()
PHP function if you want to retrieve only the texts from an HTML file and leave all HTML and PHP tags. 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 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 A is incorrect. The file_put_contents() function is used to write a string into a given file. While accessing a file, the file_put_contents() function performs the following actions:
Checks the include path for a copy of "filename" if FILE_USE_INCLUDE_PATH is set.
Creates the file if it does not exist.
Opens the file.
Locks the file if LOCK_EX is set.
Moves to the end of the file if FILE_APPEND is set. Otherwise, it clears the file content.
Writes the data into the file.
Closes the file and releases locks.
Answer option B is incorrect. The file_get_contents() function reads the entire file into a string.
https://www.php.net/manual/en/function.fgetss.php