cURL curl_multi_strerror
(PHP 5 >= 5.5.0, PHP 7, PHP 8)
curl_multi_strerror — 오류 코드를 설명하는 반환 문자열
설명
curl_multi_strerror(int $error_code
): ?string
주어진 CURLM 오류 코드를 설명하는 텍스트 오류 메시지를 반환합니다.
매개변수
error_code
- » CURLM 오류 코드 상수 중 하나입니다.
반환 값
유효한 오류 코드에 대해 오류 문자열을 반환하고 그렇지 않으면 null
을 반환합니다.
Examples
예제 #1 curl_multi_strerror() 예제
<?php
// Create cURL handles
$ch1 = curl_init("http://example.com/");
$ch2 = curl_init("http://php.net/");
// Create a cURL multi handle
$mh = curl_multi_init();
// Add the handles to the multi handle
curl_multi_add_handle($mh, $ch1);
curl_multi_add_handle($mh, $ch2);
// Execute the multi handle
do {
$status = curl_multi_exec($mh, $active);
if ($active) {
curl_multi_select($mh);
}
} while ($active && $status === CURLM_OK);
// Check for errors
if ($status != CURLM_OK) {
// Display error message
echo "ERROR!\n " . curl_multi_strerror($status);
}
?>
기타
- curl_strerror() - 주어진 오류 코드를 설명하는 반환 문자열
- » cURL error codes