Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

fgetss()

ExamplNote:e

Read a single line from the open HTML file, removing HTML tags.

<?php
$file = fopen(“test.htm”,“r”);
echo fgetss($file);
fclose($file);
?>

Definition and Usage

The fgetss() function returns a line from an open file, with HTML and PHP tags removed.

 The fgetss() function has been deprecated as of PHP 7.3.

Syntax

fgetss(filelengthtags)

Parameter Values

 

Parameter

Description

file

Mandatory. Specifies the open file from which to read a line.

length

Optional. Specifies the number of bytes to read. Reading stops when length - 1 bytes have been read, a new line is encountered, or end-of-file (EOF) is reached. Note: This parameter was required in versions prior to PHP 5.

tags

Optional. Specifies which tags should not be removed.

Technical Details

Return Value:

Returns a single line read from the file on success, or FALSE if end-of-file (EOF) is reached or an error occurs.

PHP Version:

4.0+