PHP fgetss()関数
❮PHPファイルシステムリファレンス例
開いているHTMLファイル(ストリップタグ)から1行を読み取ります。
<?php
$file = fopen("test.htm","r");
echo fgetss($file);
fclose($file);
?>
定義と使用法
fgetss()関数は、開いているファイルから1行を返します。HTMLタグとPHPタグから削除されます。
注: fgetss()関数はPHP7.3で非推奨になりました。
構文
fgetss(file, length, tags)
パラメータ値
Parameter | Description |
---|---|
file | Required. Specifies the open file to return a line from |
length | Optional. Specifies the number of bytes to read. Reading stops when length-1 bytes have been reached, or a when a new line occurs, or on EOF. Note: This parameter is required in versions prior to PHP 5 |
tags | Optional. Specifies which tags that will not be removed |
技術的な詳細
戻り値: | 成功した場合はファイルから1行が読み取られ、EOFまたはエラーの場合はFALSEが読み取られます。 |
---|---|
PHPバージョン: | 4.0以降 |
❮PHPファイルシステムリファレンス