Fgetss-function usage _ PHP Tutorial

Source: Internet
Author: User
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'{{{}'ó Ä äö öö {{° í...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.