PHP而shell_exec杀了-9

I have once asked again, I see something I will not use a while loop to go through to kill processes, unfortunately, the error message is heard in the apache log?

    sh: line 0: kill: 27185
: arguments must be process or job IDs

That this is not sure, I'm aware I just want to understand something :) hope to help

PHP Code:

$box=$_POST['delete'];
while (list ($key,$val) = @each ($box)) {
    $exe="kill -9 $val";
    shell_exec($exe);

}

greeting

$box=$_POST['delete'];
while (list ($key,$val) = @each ($box)) {
    if (!empty($val) && is_numeric($val)) { // $val is not 0 or an empty string, and is a number.
        $exe="kill -9 $val";
        shell_exec($exe);
    }
}