note 120172 added to function.curl-errno

From: Date: Tue, 15 Nov 2016 23:25:59 +0000
Subject: note 120172 added to function.curl-errno
Groups: php.notes 
Request: Send a blank email to php-notes+get-207113@lists.php.net to get a copy of this message
Gets a current list of all CURLE_* error constants, their applicable error messages, and their applicable error codes. Useful for making wrapper classes or for mapping cURL errors to specific Exception objects. <?php $list = get_defined_constants(TRUE); $list = preg_grep('/^CURLE_/', array_flip($list['curl'])); $result = array(); foreach ($list as $const) { $result[$const] = array ( 'code' => constant($const), 'message' => curl_strerror(constant($const)) ); } echo "<pre>"; echo print_r($result, TRUE); echo "</pre>"; ---- Server IP: 72.52.91.14 Probable Submitter: 24.151.144.232 ---- Manual Page -- http://php.net/manual/en/function.curl-errno.php Edit -- https://master.php.net/note/edit/120172 Del: integrated -- https://master.php.net/note/delete/120172/integrated Del: useless -- https://master.php.net/note/delete/120172/useless Del: bad code -- https://master.php.net/note/delete/120172/bad+code Del: spam -- https://master.php.net/note/delete/120172/spam Del: non-english -- https://master.php.net/note/delete/120172/non-english Del: in docs -- https://master.php.net/note/delete/120172/in+docs Del: other reasons-- https://master.php.net/note/delete/120172 Reject -- https://master.php.net/note/reject/120172 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#207113) next »