Depends on what you mean by an 'IP' being 'online'. Not every host will reply to a ping; some have it disabled as a simple means of avoiding some kinds of DOS attacks. If you're concerned about a particular service at a particular host, try to open a socket and see if it succeeds. For example, to test whether the POP server at 10.0.0.1 is up and running, do this:
if ($s = fsockopen("10.0.0.1", 110 ))
{
fclose($s);
echo "POP3 server is running";
}
else
{
echo "POP3 server (perhaps the whole machine) is down";
}