One simple way to do it is to make the variable assignment happen in file.php
If file.php looks like this ...
1 some data
2 some more data
3 more and more data
you could do something like this ...
$content="
1 some data
2 some more data
3 more and more data
";
Then when you include the file, the variable works properly. This can become an unwieldy way of doing it, but is handy on simpler includes. If you are writing the include file from another script, you can just have it write the variable stuff along with the data. You may have to escape some characters, depending on the text you are dealing with though. Heredoc might be useful here too.