public function isProcessRunning($pid) {
        if (!$pid) {
            return false;
        }

        // Is the PID running?
        $running = posix_kill($pid, 0);
        if (!$running) {
            return false;
        }

        // Did we have trouble pinging that PID?
        $psExists = !(bool)posix_get_last_error();

        return $psExists;
    }
public function isProcessRunning($pid) {
        if (!$pid) {
            return false;
        }

        // Is the PID running?
        $running = posix_kill($pid, 0);
        if (!$running) {
            return false;
        }

        // Did we have trouble pinging that PID?
        $psExists = !(bool)posix_get_last_error();

        return $psExists;
    }
public function isProcessRunning ( $ pid ) { if ( ! $ pid ) { return false ; } // Is the PID running? $ running = posix_kill ( $ pid , 0 ) ; if ( ! $ running ) { return false ; } // Did we have trouble pinging that PID? $ psExists = ! ( bool ) posix_get_last_error ( ) ; return $ psExists ; }
Check if a pid is running

@param string $pid
@return boolean
Check if a pid is running