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

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -