My script has something like this:
Code: Select all
if(isset($_SERVER['argc']) && ($_SERVER['argc'] >= 1))
{
//do something
}
else
{
if(//nothing set)
{
print 'html source + option to execute the script in cli';
}
}
Code: Select all
function execCli()
{
shell_exec("php " . __FILE__ );
}
Thanks.