php get pid code example
Example 1: get process id php
getmypid ( ) : int
Example 2: php exec get pid
$command = 'yourcommand' . ' > /dev/null 2>&1 & echo $!; ';
$pid = exec($command, $output);
var_dump($pid);
getmypid ( ) : int
$command = 'yourcommand' . ' > /dev/null 2>&1 & echo $!; ';
$pid = exec($command, $output);
var_dump($pid);