Read the file contents and write to the variable $contents:
Write the contents of the variable $contents to the file:
Of course, we can also use file_get_contents and file_put_contents to read and write files.
http://www.bkjia.com/PHPjc/822517.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/822517.htmlTechArticleRead the file contents and write to the variable $contents: ?php $fp=fopen('file.txt', 'r'); $contents=fread($fp,filesize('file.txt')); fclose($fp); ? Write the contents of the variable $contents to the file: ?...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn