Search code examples
phphtmlfile-get-contents

PHP file_get_contents function


I am developing php-based websites. When I try to load a file from the same directory using file_get_contents, the server did return some string, but php code of that file are also returned. I want the file after compiled by php, not the native code. How can I fix this problem?


Solution

  • Use this instead:

    include "file.php";