Hell all, am new here and am an intermediate php developer. I am having a silly proble am guessing the solution will be a simple syntax buh i dont know how to fix it.
Okay here is it..
Lets say i have a variable in php eg
$first_data="";
now i do something a foreach loop
foreach($file as $file)
{
$d=file_get_contents($file);
//get $first_data variable, append $d to bottom part of it
//without overwriting the content of the variable
//lets say the loop runs ten times and each time $d has diffrent contents
//i want all the contents to be added to the $first_data variable
}
file_put_contents("test_contents.txt", $first_data);
thanks for any help.