PHP fgetss() Function
Complete PHP Filesystem Reference Manual
Definition and Usage
The fgetss() function returns a line from an open file and filters out HTML and PHP tags.
fgetss() stops returning a new line when it reaches the specified length or the end of file (EOF), whichever comes first.
Returns FALSE on failure.
Syntax
fgetss(file,length,tags)
| Parameters | Description |
|---|---|
| file | Required. Specifies the file to check. |
| length | Optional. Specifies the number of bytes to read. Default is 1024 bytes.
Note:This parameter was required in versions before PHP 5. |
| tags | Optional. Specifies which tags should not be stripped. |
Example
Example 1
test.html code content:
This is a paragraph.
PHP code:
The code above will output:
This is a paragraph.
Example 2
,");
fclose($file);
?>
The code above will output:
This is a paragraph.
The source code of the output above is:
This is a paragraph.
Complete PHP Filesystem Reference Manual