Executing php inside php example
1. Create a index.php,
[php]
<?php
echo "welcome to ngdeveloper.com";
?>
[/php]
2. Create a ExecPHP.php,
[php]
<?php
echo exec("D:\\xampp\\php\\php.exe D:\\xampp\\htdocs\\index.php");
?>
[/php]
Note:
D:\\xampp\\php\\php.exe is the location of the php in the tested machine.If you have set the environment path, then you can run directly,
echo exec(“php.exe D:\\xampp\\htdocs\\index.php”);
Recommended Books: