首页 > 解决方案 > Windows 系统上的 PHP pcntl_exec 知道脚本的 PID

问题描述

我有这个代码:

if(!function_exists('pcntl_exec')){
    function pcntl_exec($path, $args=array()){
        if(is_string($args)){
            $args = array($args);
        }
        if(count($args)){
            $path = '"'.$path.'"';
        }
        $shell = new COM('WScript.Shell');
        $shell->run($path . (count($args)? ' ' . implode(' ',$args) : ''), 0, true);
    }
}

有没有办法知道 $shell->run 指令返回的 PID?Tks

标签: phppid

解决方案


推荐阅读