Php search txtcontent editor writes a small program. for example, the search content a.txt contains NAME: binsex: male and other information to read each entry into the database. There are a lot of such documents. please help !!! ------ Solution -------------------- opendir () lists all file names and reads txt (fopenfgets) cyclically (if the file is small, you can directly use file_get_contents () for analysis and save the php search txt content
Write a small program to search for content
For example, a.txt contains
NAME: Bin
SEX: Male
And other information
Read each entry to the database,
There are a lot of such documents. please help !!!
------ Solution --------------------
Opendir () lists all file names and loops
Read txt (fopen fgets. if the file is small, you can directly use file_get_contents () for analysis and save it to the database. For more information, see related functions.