PHP: SplFileObject::fgetss - Manual (original) (raw)
(PHP 5 >= 5.1.0, PHP 7)
SplFileObject::fgetss — Gets line from file and strip HTML tags
Warning
This function has been_DEPRECATED_ as of PHP 7.3.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged.
Description
public SplFileObject::fgetss(string $allowable_tags = ?): string
Parameters
allowable_tags
Optional parameter to specify tags which should not be stripped.
Return Values
Returns a string containing the next line of the file with HTML and PHP code stripped, or [false](reserved.constants.php#constant.false) on error.
Examples
Example #1 SplFileObject::fgetss() example
`<?php
$str = <<<EOD
Welcome! Today is the of .
Text outside of the HTML block. EOD; file_put_contents("sample.php", str);str);str);file = new SplFileObject("sample.php"); while (!$file->eof()) { echo $file->fgetss(); } ?>`The above example will output something similar to:
Welcome! Today is the of .
Text outside of the HTML block.
See Also
- fgetss() - Gets line from file pointer and strip HTML tags
- SplFileObject::fgets() - Gets line from file
- SplFileObject::fgetc() - Gets character from file
- SplFileObject::current() - Retrieve current line of file
- The string.strip_tags filter
Found A Problem?
There are no user contributed notes for this page.