PHP - How do I open files and read them then write new ones with “x” lines per file?
问题 I posted this question here before but there were no responses. I may have done something wrong so, here it is again with some more details. The files in the directory are named 1.txt, 2.txt, 3.txt etc.... The snippet below enters that directory, opens all the *,txt files reading them, removes the dupes and creates one file with all the unique contents. (names in this case). $files = glob($dirname."/*.txt"); //matches all text files $lines = array(); foreach($files as $file) { $lines = array