hey Guys,
I know this question is probably straightfoward but I'm new to php and programming... I want to write the results of a recursive search to a text file, and also ensuring that any other search performed will not overwrite the exisiting data, but add to it.
here is my code:
<?php
$it = new RecursiveDirectoryIterator("L:\folder\folder\folder");
$display = Array ( 'jpeg', 'jpg', 'tif', 'tiff', 'bmp', 'shp', 'gif', 'png' );
foreach(new RecursiveIteratorIterator($it) as $file)
{
if ( In_Array ( SubStr ( $file, StrrPos ( $file, '.' ) + 1 ), $display ) == true )
{
echo $file . "<br/> \n";
}
}
?>
So instead of echoing the result, I'd rather it be written to a text file. Also, if it is possible, echo the result and write it to a text file. plz let me know what code I can add in to achieve this thanks :)