PHP: Return An include And Assign It To A Variable

The include statement is a simple way to include PHP code from another file.

The usage is quite simple. Just write something like this:

include 'a_file.php';

If the file is successfully included it will return a TRUE or 1. If it failes to include the file it will return a FALSE. But sometimes you may need to get the content of an included file in order to store it in an variable. Unfortunately the include statement just returns TRUE or FALSE, as mentioned above.

Read more