What is a php file? PHP introductory learning knowledge point 6. The reading and writing operation code of PHP files

WBOY
Release: 2016-07-29 08:46:04
Original
1200 people have browsed it

Copy the code The code is as follows:


//Open the file
$fp=fopen('tmp.html', 'r');
//You can use the following two methods to read the file content Function to operate fread, file_get_contents
$str=fread($fp, filesize('tmp.html')); //filesize is to get the file size
$c
//Write the file
$news=fopen('news. html', 'w');
fwrite($news, $content);
//Close the file stream
fclose($fp);
fclose($news);
echo $content;
?>

The above introduces what kind of file php is. Knowledge point 6 for introductory learning of php. The code for reading and writing PHP files, including what kind of file php is. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template