PHP fopen()函数 open()函数可以打开一个文件或URL。如果open()失败,它会返回false,以及一个错误信息。我们可以在函数名前面加上’@’来隐藏错误输出。 语法 resource fopen ( string filename , stringmode [, bool use_include_path = FALSE [, resourcecontext ]] )PHPCopy fopen() 函数可以将指定的文件名绑定到一个流。 示例 <?php file = fopen("/PhpProject/sample.txt", "r");file = fopen("/PhpProject/index.php", "r"); $file = fopen("/PhpProject/sample1.txt", "wb"); ?>PHPCopy