ユーザ用ツール

サイト用ツール


サイドバー


メニュー




スポンサーリンク





php:関数使用例:ファイルシステム:fgets

PHP:関数使用例:ファイルシステム:fgets

分類

ファイルシステム

機能

ファイルポインタから 1 行取得します。

sample

ソース

<html>
<head>
<title>t_file_exist.php</title>
<body>
<?php
$file_name ="/home/hoge/public_html/test/test.txt";
$file = fopen($file_name,"r") or die("File Open Error");
$buff = fgets($file);
echo $buff;
?>
</body>
</html>

test.txt

hellow php

出力結果

hellow php  
php/関数使用例/ファイルシステム/fgets.txt · 最終更新: 2015/12/08 02:07 by dokuroot