Blogger Information
Blog 21
fans 0
comment 0
visits 21099
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
php读取txt文件内容
星辰大海
Original
2992 people have browsed it
$file = fopen('1.txt', "r");
$data = [];
while(! feof($file))
{
	$content = fgets($file); //逐行取出
	$data[] = $content;
}
fclose($file);

写入文件方法:

file_put_contents($file, $str, FILE_APPEND);

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post