PHP URL HTTP상태코드 확인 get_http_code()

(PHP get http code()에서 넘어옴)

1 개요[ | ]

PHP get_http_code()
PHP url HTTP상태코드 확인
PHP
Copy
$url = 'http://example.com';
$ch = curl_init($url);
curl_setopt($ch,  CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

2 같이 보기[ | ]

3 참고[ | ]