问题 I have this little script, which should ping the IPs in the $hosts_to_ping array. This PHP is called with JavaScript in the index.html. But something is wrong, because the $rval is always 1 (which mean the host is unreachable). But I know that the first two host are alive. So I print the $res variable, and I see the message: Need to give the IP . I don't understand why it doesn't replace the $host variable to the actual IP address in the function. <?php function ping($host) { exec(sprintf(