Suppose if I have a PHP script test.php which have a method
<?php
function execute($filename){
//do something
return $output;
}
?>
and I also have another PHP script executable.php
<?php
echo "I am executed";
?>
then can i run any code to excute the second file and return the output from the first method execute when i call echo execute('executable.php'); ?
I guess you guys can understand what I meant.
You can use output buffering, as long as the file being included doesn’t already do that: