Hi I need to execute a php child.php
which is on the folder child
, from another php named parent.php
, and get the out put of child.php
at parent.php
. I have the below code but not works as the child.php
should executed from the folder child
itself.
How can resolve the issue, like change the directory to child
and execute the php there and get the output.
function execute($filename){
ob_start();
include $filename;
$output = ob_get_contents();
ob_end_clean();
return $output;
}