Writing to a Text File (PHP) -
I know this question is probably straightforward but I'm new to PHP and programming ... I want to write the results I'm looking for a recursive search for a text file and also to make sure that no other search will overwrite the executed data, but add to it.
Here's my code:
& lt ;? Php $ it = new recurring directoryererator ("L: \ folder \ folder \ folder"); $ Display = Array ('JPG', 'JPG', 'TIF', 'TIFF', 'BMP', 'SPP', 'GIF', 'PNG'); Foreach (New recursive iterator iterator $ $ as file) {If (In_Array (SubStr ($ file, StrrPos ($ file, '.') + 1), $ display) {$ true} {echo $ file "
So instead of resonating the result, I would like to write it in a text file as well, if If this is possible, resonate the result and write it in a text file. Plz let me know that I can add the code to get this thank you :)
Efforts to:
& lt ;? Php $ it = new recurring directoryererator ("L: \ folder \ folder \ folder"); $ Display = Array ('JPG', 'JPG', 'TIF', 'TIFF', 'BMP', 'SPP', 'GIF', 'PNG'); $ Fp = fopen ("output.txt", "a"); Foreach (New recursive iterator iterator $ $ as file) {if (array_array (substream ($ file, stropos ($ file, '.') + 1), $ display) == true) {// echo $ File "& lt; br / & gt; \ n"; Filitt ($ FP, $ file. "\ N"); }} Fclose ($ fp); ? & Gt;
See also for more information about writing files.
Comments
Post a Comment