PHP7.0安裝筆記整理
839
2023-12-10
(PHP 5 >= 5.5.0)
curl_strerror — Return string describing the given error code
$errornum
)
Returns a text error message describing the given error code.
errornum
One of the » cURL error codes constants.
Returns error description or NULL
for invalid error code.
Example #1 curl_errno() example
<?php
// Create a curl handle with a mispelled protocol in URL
$ch = curl_init("htp://example.com/");
// Send request
curl_exec($ch);
// Check for errors and display the error message
if($errno = curl_errno($ch)) {
$error_message = curl_strerror($errno);
echo "cURL error ({$errno}):n {$error_message}";
}
// Close the handle
curl_close($ch);
?>
以上例程會輸出:
cURL error (1): Unsupported protocol
curl_errno() - 返回最后一次的錯誤號 curl_error() - 返回一個保護當前會話最近一次錯誤的字符串 » Curl error codes
#免責聲明#
本站[綠夏技術導航]提供的一切軟件、教程和內容信息僅限用于學習和研究目的;不得將上述內容用于商業或者非法用途,否則,一切后果請用戶自負。本站信息來自網絡收集整理,版權爭議與本站無關。您必須在下載后的24個小時之內,從您的電腦或手機中徹底刪除上述內容。如果您喜歡該程序或內容,請支持正版,購買注冊,得到更好的正版服務。我們非常重視版權問題,如有侵權請郵件[admin@lxwl520.com]與我們聯系進行刪除處理。敬請諒解!