Php getting started to learn how to read and write php files. Copy the code as follows :? Open the file using php: fpfopen(tmp.html, r); use the following two functions to read the file content: fread, file_get_contents $ strfread ($ fp, file
The code is as follows:
// Open the file
Using fpw.fopen('tmp.html ', 'r ');
// You can use the following two functions to read the file content: fread and file_get_contents.
$ Str = fread ($ fp, filesize('tmp.html '); // filesize is the file size.
Using content1_file_get_contents('tmp.html ');
// Write an object
Using newsjavasfopen('news.html ', 'w ');
Fwrite ($ news, $ content );
// Close the file stream
Fclose ($ fp );
Fclose ($ news );
Echo $ content;
?>
The http://www.bkjia.com/PHPjc/323823.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/323823.htmlTechArticle code is as follows :? Php // open the file javasfpw.fopen('tmp.html ', 'r'); // you can use the following two functions to read the file content: fread, file_get_contents $ str = fread ($ fp, file...