php, codeigniter

서버 점검(ping) 테스트

디츠 2015. 10. 17. 23:05
function ping($host, $port=80, $timeout=6) {
	$fsock = fsockopen($host, $port, $errno, $errstr, $timeout);
	if (!$fsock) {
		return FALSE;
	} else {
		fclose($fsock);
		return TRUE;
	}
}
출처 : http://www.cikorea.net/tip/view/2002/page/1/