{"id":42,"date":"2013-03-19T16:58:57","date_gmt":"2013-03-19T16:58:57","guid":{"rendered":"http:\/\/ecodebook.wordpress.com\/?p=42"},"modified":"2013-03-19T16:58:57","modified_gmt":"2013-03-19T16:58:57","slug":"php-get-the-http-status-code-using-curl","status":"publish","type":"post","link":"https:\/\/blog.mycarts.shop\/?p=42","title":{"rendered":"PHP: Get the HTTP status code using curl"},"content":{"rendered":"<p>[code language=&#8221;php&#8221;]<br \/>\n$url = parse_url(&#8216;http:\/\/google.com&#8217;);<\/p>\n<p>$http = curl_init($url);<\/p>\n<p>$result = curl_exec($http);<\/p>\n<p>$http_status = curl_getinfo($http, CURLINFO_HTTP_CODE);<\/p>\n<p>echo $http_status;<br \/>\n[\/code]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[code language=&#8221;php&#8221;] $url = parse_url(&#8216;http:\/\/google.com&#8217;); $http = curl_init($url); $result = curl_exec($http); $http_status = curl_getinfo($http, CURLINFO_HTTP_CODE); echo $http_status; [\/code]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-42","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/posts\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=42"}],"version-history":[{"count":0,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/posts\/42\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}