fclose

(PHP 4, PHP 5, PHP 7, PHP 8)

fclose关闭一个已打开的文件指针

说明

fclose(resource $stream): bool

stream 指向的文件关闭。

参数

stream

文件指针必须有效,并且是通过 fopen()fsockopen() 成功打开的。

返回值

成功时返回 true, 或者在失败时返回 false

范例

示例 #1 一个简单 fclose() 例子

<?php

$handle
= fopen('somefile.txt', 'r');

fclose($handle);

?>

参见

  • fopen() - 打开文件或者 URL
  • fsockopen() - 打开 Internet 或者 Unix 套接字连接

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top