I am attempting to read in multiple files, where the filename of each file is contained within a central file "order.txt", and take the content and append it to a single string variable in PHP.
This is my current approach:
$order = file("order.txt");
$content = "";
foreach($order as $line) {
$content = $content . file_get_contents($line);
}
return $content;
order.txt
one.txt
two.txt
three.txt
However, when "content" is returned, it only contains the data within the last file (in this case, "three.txt"). How can I ensure the content from all files are appended to the "content" variable?