![]() |
VOOZH | about |
The fgetss() function in PHP is an inbuilt function which is used to return a line from an open file after removing HTML and PHP tags from the respective file.
The fegtss() function stops returning at a specified length, on end of file(EOF) or on a new line, whichever comes first.
The file to be read and the number of bytes to be read are sent as parameters to the fgetss() function and it returns a string of length -1 bytes from the file pointed by the user. It returns False on failure.
Syntax:
fgetss(file, length, tags)
Parameters Used:
The fgetss() function in PHP accepts three parameter.
Return Value:
It returns a string of length -1 bytes from the file pointed by the user after removing all the HTML and PHP tags.
Errors And Exception:
Below programs illustrate the fgetss() function.
Suppose there is a file named "gfg.txt" which consists of :
👁 Image
Program 1
Output:
This is the first line.
Program 2
Output:
👁 ImageReference:
https://www.php.net/manual/en/function.fgetss.php