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: ?...