Using a wamp / php 5.3 I have a weird behavior I'd like your opinion about...
I need to execute some external/shell commands but when I pack them in function the exec() doesn't seem to work anymore...
Exemple: If I do something like:
<?php
/// some stuff
$getAppCmd = $CLI_CMD." -q -f ".$CLI_REQ_PATH."\getApp.py";
exec($getAppCmd, $apps, $rt);
print_r($apps);
/// other stuff
?>
==> It works just fine :)
BUT, if I try to achieve something more reusable:
<?php
// Some stuff
function getApp(){
$getAppCmd = $CLI_CMD." -q -f ".$CLI_REQ_PATH."\getApp.py";
exec($getAppCmd, $apps, $rt);
print_r($apps);
return $apps;
}
$list = getApp();
print_r($list);
//other stuff
?>
==> I'm printing nothing Array() Array()
Am I missing something ?
I've been through some several thread but couldn't find something to guide me, return is supposed to work even if I'm returning an array, and the command is the same inside & outside the function...
I don't get it and need bit of your help.
Thanks !
globphp.net/manual/ru/function.glob.php