Fgetss-function usage fgetss
(PHP 4, PHP 5, PHP 7)
Fgetss-read a row from the file pointer and filter out the HTML tag
Description
String fgetss (resource $ handle [, int $ length [, string $ allowable_tags])
Similar to fgets (), only fgetss () tries to remove any HTML and PHP markup from the read text.
Parameters
Handle
The file pointer must be valid and must be directed to a file successfully opened by fopen () or fsockopen () (not closed by fclose ).
Length
Retrieve data of this length.
Allowable_tags
You can use the optional third parameter to specify which tags will not be removed.
Return value
Read the length-1 byte characters from the handle object and filter all HTML and PHP code.
If an error occurs, FALSE is returned.
$ Str = <
Welcome! Today is Of .
Text outside of the HTML block.
EOD;
File_put_contents ('sample. php', $ str );
$ Handle = @ fopen ("sample. php", "r ");
If ($ handle ){
While (! Feof ($ handle )){
$ Buffer = fgetss ($ handle, 4096 );
Echo $ buffer;
}
Fclose ($ handle );
}
?>
Http://www.bkjia.com/PHPjc/445478.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445478.htmlTechArticlefgetss-» n'{{{}'ó Ä äö öö {{{° í '? fgetss-» n'{{{}'ó Ä äö öö {{° í...