| |
| fopen( ) |
| |
if (!$fp = fopen($testFile, "r")) {
echo "could not open";
exit;
}
|
| |
( ファイルオープンモード一覧 ) |
| |
| fread( ) |
| |
$contents = fread($fp, filesize($testFile));
|
| |
| 〜実行〜 |
| |
$testFile = "test.dat";
if (!$fp = fopen($testFile, "r")) {
echo "could not open";
exit;
}
$contents = fread($fp, filesize($testFile)); <-- 最大サイズまで読み込んで"$contents"に返す
var_dump($contents);
fclose($fp);
|
| |
|
|