Like @marc, exec actually returns the PID of the process.
However, this is still a “dodgy” syntax for use in PHP, as you have to be careful to put it in, ''
otherwise PHP will do something special with it. Basically, PHP has the ability to use variables in two ways:
$a
and
$$a
The latter, using the value of $ a to actually jump to the new variable name, so you have to be careful how you use this syntax (http://www.php.net/manual/en/language.variables. Variable.php) .
source share