fgets and fgetss

fgets and fgetss

fgets:
=====

fgets
- It gets line from file pointer.

Syntax :
======

string fgets ( int fp [, int length])

It returns a string of up to length - 1 bytes read from the file pointed to by fp. Reading ends when length - 1 bytes have been read, on a newline (which is included in the return value), or on EOF (whichever comes first). If no length is specified, the length defaults to 1k, or 1024 bytes.

If an error occurs, returns FALSE.

fgetss:
=====

fgetss — Gets line from file pointer and strip HTML tags

Syntax:
======

string fgetss ( int fp, int length [, string allowable_tags])

It is similar  to fgets(), except that fgetss attempts to strip any HTML and PHP tags from the text it reads.

You can also use the optional third parameter to specify tags which should not be stripped.

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.