<?PHP
function return_output($file){
ob_start();
include $file;
return ob_get_clean();
}
$content = return_output('some/file.php')
Reference:
https://stackoverflow.com/questions/2150194/how-do-you-define-a-php-include-as-a-string
Article ID: 49
Created On: Sun, Oct 4, 2020 at 5:42 PM
Last Updated On: Sun, Oct 4, 2020 at 5:42 PM
Authored by: Saeed Nobakht [[email protected]]
Online URL: https://www.navel.ir/article/how-do-you-define-a-php-include-as-a-string-49.html