略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: win32_ps_list_procs

2024-05-01

win32_ps_list_procs

(PECL win32ps >= 1.0.1)

win32_ps_list_procsList running processes

说明

win32_ps_list_procs ( void ) : array

Retrieves statistics about all running processes.

返回值

Returns FALSE on failure, or an array consisting of process statistics like win32_ps_stat_proc() returns for all running processes on success.

参见

add a note add a note

User Contributed Notes 1 note

up
0
cf at chronofish dot com
11 years ago
For those of you in the WAMP environment, here is a little function that you may find handy:

<?
function kill_proc($processName)
{
    @$processList = win32_ps_list_procs();
    foreach ($processList as $processArray)
    {
        $pid = $processArray['pid'];
        if (basename($processArray['exe']) == $processName)
        {           
            `taskkill /f /PID $pid 2>&1`;                   
        }
    }
}
?>

-CF

官方地址:https://www.php.net/manual/en/function.win32-ps-list-procs.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3