Skip to content
Advertisement

How to access content from multiple files

Is there any way that I can add the content of multiple files then put the combined values into one file?

I am currently trying this:

JavaScript

Advertisement

Answer

include is for code, not for content. In your case you have to use file_get_contents so you can save the returned value. include will not give you that value.

include()

Handling Returns: include returns FALSE on failure and raises a warning. Successful includes, unless overridden by the included file, return 1.

JavaScript

Now you can use your variable like you did.

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