Skip to content
Advertisement

Read and join multiple remote files PHP

I’m using this code to read multiple remote files:

JavaScript

I’ve noticed that the output content is truncated like just one file is processed, but what I need is to join the three files to manipulate them. How I can achive this?

Advertisement

Answer

The scope of $parsed is limited to the foreach loop, so $output only contains results from the last iteration of the loop. You should define $output before the loop, and append the results of each iteration to it.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement