1
I would like to create a php file and make it scan a directory and search for files. txt
Scan for example all the . txt files from the /files/ folder (and all its Ubdirectories)
Each file he scans I need him to try to find inside the contents of the file, a keyword, like, "MARIA".
At the end he go through all the files, show something like this:
002023.txt - Maria found - Line 1 002023.txt - Maria found - Line 10 565454.txt - Maria found - Line 400 231332.txt - Maria found - Line 100
Someone can help me?
Thank you
Implementing Daniel’s answer: You can use a linux command (if you’re working on a linux server), searching for the files you want before working with them internally. Run tests with "exec": http://php.net/manual/en/function.exec.php and use the find linux command: https://www.vivaolinux.com.br/dica/Busca-por-string-dentro-dos-arquivos Good luck!
– Fabio Fila