Home > Backend Development > PHP Tutorial > php搜索txt内容,该如何处理

php搜索txt内容,该如何处理

WBOY
Release: 2016-06-13 09:58:56
Original
1872 people have browsed it

php搜索txt内容
编写一个小程序,搜索内容
如A.txt中有
NAME:彬
SEX:男
等信息
读取每一条到数据库中、
有大量这种的文档,求帮助!!!

------解决方案--------------------
opendir() 列出所有文件名,进行循环

读txt(fopen fgets,文件小的话,可以直接用file_get_contents()),进行分析,保存进数据库,具体的请参考相关函数.

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