{"id":3036,"date":"2016-05-23T20:35:59","date_gmt":"2016-05-23T12:35:59","guid":{"rendered":"http:\/\/blog.hoyo.idv.tw\/?p=3036"},"modified":"2025-03-13T16:27:29","modified_gmt":"2025-03-13T08:27:29","slug":"php-curl-%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/blog.hoyo.idv.tw\/?p=3036","title":{"rendered":"PHP curl \u4f7f\u7528"},"content":{"rendered":"<p>--<\/p>\n<p>PHP curl \u6703\u6709\u4e0d\u4f7f\u7528 \/etc\/hosts \u554f\u984c\uff0c\u56e0\u6b64\u5728\u5167\u7db2\u5982\u679c\u6709\u4f7f\u7528 \/etc\/hosts \u8a2d\u5b9a\u5167\u7db2 ip \u6c92\u4f5c\u7528<\/p>\n<p>PHP 5.4 \u554f AI \u4e5f\u7121\u6cd5\u89e3\u6c7a\uff0cCURLOPT_RESOLVE \u8981\u5230 PHP 5.5 \u624d\u652f\u63f4<\/p>\n<p>--<\/p>\n<h2>\u57fa\u672c\u4f7f\u7528<\/h2>\n<p>\u4f7f\u7528\u00a0CURLOPT_URL \u8a2d\u5b9a\u9023\u7d50\u7db2\u5740\uff0c\u7136\u5f8c\u57f7\u884c\u5373\u53ef\u3002\u9806\u5229\u7684\u8a71\u5c31\u53ef\u4ee5\u53d6\u5f97\u56de\u50b3\u7db2\u9801\u539f\u59cb\u78bc<\/p>\n<pre class=\"lang:php decode:true\">$ch = curl_init();\r\ncurl_setopt($ch, CURLOPT_URL, 'http:\/\/www.ted.com\/');\r\ncurl_exec($ch);\r\ncurl_close($ch);<\/pre>\n<p>--<\/p>\n<h2>\u4e0d\u76f4\u63a5\u986f\u793a\u53d6\u5f97\u5167\u5bb9<\/h2>\n<p>\u5c07\u00a0CURLOPT_RETURNTRANSFER \u8a2d\u5b9a\u70ba true \u5373\u53ef<\/p>\n<pre class=\"lang:php decode:true\">&lt;?php\r\n$ch = curl_init();\r\ncurl_setopt($ch, CURLOPT_URL, 'http:\/\/www.ted.com');\r\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER , 1); \/\/ \u4e0d\u76f4\u63a5\u51fa\u73fe\u56de\u50b3\u503c\r\ncurl_exec($ch);\r\ncurl_close($ch);<\/pre>\n<p>--<\/p>\n<h2>\u52a0\u4e0a POST \u8cc7\u6599<\/h2>\n<p>\u589e\u52a0\u00a0CURLOPT_POSTFIELDS \u53c3\u6578\uff0c\u50b3\u905e array() \u9663\u5217<\/p>\n<p>Google+ \u5728 OAuth \u5167\u7684\u8cc7\u8a0a\u5fc5\u9808\u4f7f\u7528 POST \u50b3\u905e\uff0c\u4f7f\u7528\u65b9\u6cd5\u5927\u81f4\u5982\u4e0b<\/p>\n<pre class=\"lang:php decode:true\">$send_url = $this-&gt;accounts_oauth2_token;\r\n$token_post = array(\r\n    \"code\" =&gt; $code,\r\n    \"client_id\" =&gt; $this-&gt;client_id,\r\n    \"client_secret\" =&gt; $this-&gt;client_secret,\r\n    \"redirect_uri\" =&gt; $this-&gt;redirect_uri,\r\n    \"grant_type\" =&gt; \"authorization_code\"\r\n);\r\n\r\n$ch = curl_init();\r\ncurl_setopt($ch, CURLOPT_URL, $send_url);\r\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $token_post);\r\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER , 1); \/\/ \u4e0d\u76f4\u63a5\u51fa\u73fe\u56de\u50b3\u503c\r\n$response = curl_exec($ch); \/\/ \u56de\u50b3 access_token\r\ncurl_close($ch);\r\n<\/pre>\n<p>--<\/p>\n<h2>\u53d6\u5f97\u8655\u7406\u72c0\u614b<\/h2>\n<p>curl_getinfo() \u53ef\u4ee5\u5f97\u77e5\u57f7\u884c\u5f8c\u7d50\u679c<\/p>\n<pre class=\"lang:php decode:true\">$ch = curl_init();\r\ncurl_setopt($ch, CURLOPT_URL, $m3u8);\r\ncurl_setopt($ch, CURLOPT_REFERER, 'http:\/\/hichannel.hinet.net\/radio\/index.do' );\r\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\ncurl_exec($ch);\r\n$info = curl_getinfo($ch);\r\ncurl_close($ch);\r\n\r\n\/\/ \u4e0d\u53ef\u7528\u8cc7\u6e90\u56de\u50b3 410\r\nif ( $info['http_code'] == '200' ) {\r\n    echo $m3u8;\r\n    break;\r\n}\r\nelse {\r\n    \/\/echo $m3u8;\r\n    echo $i++;\r\n    \/\/sleep(1);\r\n}\r\n<\/pre>\n<p>--<\/p>\n<h2>\u8a2d\u5b9a\u6216\u589e\u52a0\u5176\u4ed6\u529f\u80fd\u3001\u53c3\u6578<\/h2>\n<ul>\n<li><a href=\"http:\/\/php.net\/manual\/zh\/curl.constants.php\" target=\"_blank\" rel=\"noopener\">curl\u00a0\u9884\u5b9a\u4e49\u5e38\u91cf<\/a><\/li>\n<\/ul>\n<pre class=\"lang:php decode:true\">$ch = curl_init();\r\ncurl_setopt($ch, CURLOPT_URL, $URL .'\/adv.do');\r\ncurl_setopt($ch, CURLOPT_REFERER, 'http:\/\/hichannel.hinet.net' );\r\ncurl_exec($ch);\r\ncurl_close($ch);\r\n<\/pre>\n<p>\u8a2d\u5b9a\u00a0REFERER \u53c3\u7167\u4f86\u6e90\u7db2\u5740<\/p>\n<p>--<\/p>\n<h2>\u5982\u4f55\u5f97\u77e5\u9001\u51fa\u7684 Head ?<\/h2>\n<p>\u6b65\u9a5f<\/p>\n<ol>\n<li>\u8a2d\u5b9a\u00a0CURLINFO_HEADER_OUT \u70ba true<\/li>\n<li>\u4f7f\u7528 curl_getinfo() \u53d6\u5f97\u8f38\u51fa\u7d50\u679c\uff0c \u9001\u51fa Head \u4e5f\u5728\u7d50\u679c\u5167<\/li>\n<\/ol>\n<pre class=\"lang:php decode:true\">$ch = curl_init();\r\ncurl_setopt($ch, CURLOPT_URL, 'http:\/\/radio-hichannel.cdn.hinet.net\/crossdomain.xml');\r\ncurl_setopt($ch, CURLOPT_USERAGENT,'Mozilla\/5.0 (Windows NT 6.1; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/50.0.2661.94 Safari\/537.36');\r\ncurl_setopt($ch, CURLOPT_REFERER, 'http:\/\/hichannel.hinet.net\/radio\/index.do' );\r\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array(\"X-Requested-With: ShockwaveFlash\/21.0.0.216\", \"Host: radio-hichannel.cdn.hinet.net\"));\r\ncurl_setopt($ch, CURLINFO_HEADER_OUT, true);\r\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER , 1);\r\n\r\n$crossdomain = curl_exec($ch);\r\n$info = curl_getinfo($ch);\r\ncurl_close($ch);<\/pre>\n<p>--<\/p>\n<h2>\u589e\u52a0\u81ea\u5b9a\u7fa9 Head<\/h2>\n<ul>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/10996729\/posting-from-curl-http-x-requested-with\">Posting from cURL: HTTP_X_REQUESTED_WITH<\/a><\/li>\n<\/ul>\n<pre class=\"lang:php decode:true\">$ch = curl_init();\r\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array(\"X-Requested-With: XMLHttpRequest\"));\r\n$result = curl_exec ($ch);\r\ncurl_close ($ch);<\/pre>\n<p>--<\/p>\n<h2>\u589e\u52a0\u81ea\u5b9a\u7fa9 - \u50b3\u905e\u9023\u7dda IP<\/h2>\n<ul>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/1301319\/curl-ip-address\">cURL ip address<\/a><\/li>\n<\/ul>\n<pre class=\"lang:php decode:true\">curl_setopt($ch, CURLOPT_HTTPHEADER , array(\"REMOTE_ADDR: $ip\"));<\/pre>\n<p>HEAD \u540d\u7a31\u524d\u9762\u5f37\u5236\u52a0\u4e0a <strong>HTTP_<\/strong> \u958b\u982d\uff0c\u56e0\u6b64\u53d6\u5f97 IP \u6642\u5fc5\u9808\u76f8\u4e92\u642d\u914d<\/p>\n<pre class=\"lang:default decode:true\">Array\r\n(\r\n    [REDIRECT_STATUS] =&gt; 200\r\n    [HTTP_HOST] =&gt; soundu2.mj-app.com.tw\r\n    [HTTP_ACCEPT] =&gt; *\/*\r\n    [HTTP_REMOTE_ADDR] =&gt; 8.8.8.8\r\n    [CONTENT_LENGTH] =&gt; 177\r\n:\r\n:<\/pre>\n<p>--<\/p>\n<p><strong>\u76ee\u7684\u7aef PHP \u53d6\u5f97 IP \u7a0b\u5f0f\u65b9\u6cd5<\/strong><\/p>\n<p>\u9996\u5148\u8acb\u5148\u770b\u4ee5\u4e0b\u53c3\u8003\u9023\u7d50<\/p>\n<ul>\n<li><a href=\"http:\/\/www.dewen.net.cn\/q\/1391\/curl+%E5%A6%82%E4%BD%95%E6%A8%A1%E6%8B%9Fremote_addr+%E5%8F%96%E7%9A%84ip?sort=active\" target=\"_blank\" rel=\"noopener\">curl \u5982\u4f55\u6a21\u62dfremote_addr \u53d6\u7684ip<\/a><\/li>\n<\/ul>\n<p>\u9019\u88e1\u8a0e\u8ad6\u5230\u4e00\u6bb5\u7db2\u8def\u666e\u904d\u300c\u8b20\u50b3\u300d\u7684\u53d6\u5f97 IP \u4ee3\u78bc<\/p>\n<pre class=\"lang:default decode:true\">if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\r\n    $ip = $_SERVER['HTTP_CLIENT_IP'];\r\n} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\r\n    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n} else {\r\n    $ip = $_SERVER['REMOTE_ADDR'];\r\n}<\/pre>\n<p>\u5927\u90e8\u5206\u6284\u9019\u6bb5\u7a0b\u5f0f\u78bc\u7684\u4eba\u90fd\u4e0d\u77e5\u9053\u70ba\u4ec0\u9ebc\u8981\u5148\u53d6\u00a0HTTP_CLIENT_IP \u548c\u00a0HTTP_X_FORWARDED_FOR \u9019\u5169\u500b\u503c\uff0c\u7b49\u5b78\u6703 curl \u4e4b\u5f8c\u5c31\u6703\u77e5\u9053\u5927\u5927\u8aaa\u9019\u662f\u552c\u721b\u662f\u6b63\u78ba\u7684\u3002<\/p>\n<pre class=\"lang:php decode:true\">&lt;?php\r\nif (!empty($_SERVER['HTTP_CLIENT_IP'])) {\r\n    $ip = $_SERVER['HTTP_CLIENT_IP'];\r\n} else {\r\n    $ip = $_SERVER['REMOTE_ADDR'];\r\n}\r\n\r\n$ss = print_r($_SERVER, true);\r\nfile_put_contents('\/tmp\/curl.log', $ss, FILE_APPEND | LOCK_EX);<\/pre>\n<p>\u60f3\u8981\u77e5\u9053\u63a5\u6536\u7aef\u8cc7\u8a0a\u5fc5\u9808\u53e6\u5916\u5132\u5b58\uff0c\u6587\u5b57\u6a94\u3001\u8cc7\u6599\u5eab\u7b49\u90fd\u53ef\u4ee5\uff0c\u70ba\u4e86\u65b9\u4fbf\u9019\u88e1\u4f7f\u7528\u6587\u5b57\u6a94<\/p>\n<p>--<\/p>\n<h2>\u96b1\u85cf _SERVER['REMOTE_ADDR']<\/h2>\n<ul>\n<li><a href=\"http:\/\/m.oschina.net\/blog\/368683\" target=\"_blank\" rel=\"noopener\">PHP\u4e16\u754c\u4e0d\u7b97\u6f0f\u6d1e\u7684\u6f0f\u6d1e - \u4f60\u6c38\u8fdc\u83b7\u5f97\u4e0d\u5230\u6211\u7684\u771f\u5b9eIP<\/a><\/li>\n<li><a href=\"http:\/\/proxy.goubanjia.com\/\">\u5168\u7f51\u4ee3\u7406IP<\/a><\/li>\n<\/ul>\n<pre class=\"lang:php decode:true\">\/\/curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); \/\/ \u5c1a\u672a\u77e5\u9053\u78ba\u5207\u7528\u9014\r\ncurl_setopt($ch, CURLOPT_PROXY , \"186.90.211.39:8080\");\r\n<\/pre>\n<p>\u8a2d\u5b9a\u4f7f\u7528 Proxy Server \u4ee3\u7406\u9023\u7dda\uff0c\u5c0d\u65b9\u53d6\u5f97\u7684 REMOTE_ADDR \u5c31\u662f Proxy Server \u7684 IP<\/p>\n<pre class=\"lang:default decode:true \">Array\r\n(\r\n    [UNIQUE_ID] =&gt; V0MapsCoAAMAAYZQ9qcAAAAD\r\n    [HTTP_HOST] =&gt; hoyo.idv.tw\r\n    [HTTP_CONNECTION] =&gt; close\r\n    [HTTP_VIA] =&gt; 1.0 tinyproxy (tinyproxy\/1.8.2)\r\n    [HTTP_ACCEPT] =&gt; *\/*\r\n    [HTTP_CLIENT_IP] =&gt; 8.8.8.8\r\n    [PATH] =&gt; \/sbin:\/bin:\/usr\/sbin:\/usr\/bin:\/usr\/games:\/usr\/local\/sbin:\/usr\/local\/bin:\/root\/bin:\/usr\/local\/texlive\/2010\/bin\/amd64-freebsd\r\n    [SERVER_SIGNATURE] =&gt; \r\n    [SERVER_SOFTWARE] =&gt; Apache\/2.2.25 (FreeBSD) PHP\/5.5.4 mod_ssl\/2.2.25 OpenSSL\/0.9.8x DAV\/2\r\n    [SERVER_NAME] =&gt; hoyo.idv.tw\r\n    [SERVER_ADDR] =&gt; 192.168.0.3\r\n    [SERVER_PORT] =&gt; 80\r\n    [REMOTE_ADDR] =&gt; 186.90.211.39\r\n    [DOCUMENT_ROOT] =&gt; \/WEBSite\/www\/WWW\r\n    [SERVER_ADMIN] =&gt; pc@hoyo.idv.tw\r\n    [SCRIPT_FILENAME] =&gt; \/WEBSite\/www\/WWW\/curlx.php\r\n    [REMOTE_PORT] =&gt; 43403\r\n    [GATEWAY_INTERFACE] =&gt; CGI\/1.1\r\n    [SERVER_PROTOCOL] =&gt; HTTP\/1.0\r\n    [REQUEST_METHOD] =&gt; GET\r\n    [QUERY_STRING] =&gt; \r\n    [REQUEST_URI] =&gt; \/curlx.php\r\n    [SCRIPT_NAME] =&gt; \/curlx.php\r\n    [PHP_SELF] =&gt; \/curlx.php\r\n    [REQUEST_TIME_FLOAT] =&gt; 1464015526.863\r\n    [REQUEST_TIME] =&gt; 1464015526\r\n)\r\n<\/pre>\n<p>--<\/p>\n<h2>\u9001\u51fa HTTP Auth<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.electrictoolbox.com\/php-curl-sending-username-password\/\" target=\"_blank\" rel=\"noopener\">Sending a username and password with PHP CURL<\/a><\/li>\n<\/ul>\n<p>\u5982\u679c\u6709\u4e00\u500b\u7db2\u9801\u4f7f\u7528 HTTP Auth \u4f7f\u7528\u8005\u8a8d\u8b49\uff0c\u8a72\u5982\u4f55\u4f7f\u7528 PHP curl \u767b\u9304\u53d6\u5f97\u8cc7\u6599\uff1f<\/p>\n<p>\u4ee5\u4e0b\u662f zopim \u7684\u53d6\u5f97\u804a\u5929\u7d00\u9304\u7bc4\u4f8b\uff0c\u672c\u4f86\u662f\u4f7f\u7528 Linux curl \u6307\u4ee4\u64cd\u4f5c\u7684\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre class=\"lang:default decode:true \">curl https:\/\/www.zopim.com\/api\/v2\/chats -v -u username:password<\/pre>\n<p>PHP \u53ef\u4ee5\u9019\u6a23\u5be6\u73fe<\/p>\n<pre class=\"lang:php decode:true\">$username = ZOPIM_Username;\r\n$password = ZOPIM_Password;\r\n$URL = 'https:\/\/www.zopim.com\/api\/v2\/chats';\r\n\r\n$ch = curl_init();\r\ncurl_setopt($ch, CURLOPT_URL,$URL);\r\ncurl_setopt($ch, CURLOPT_TIMEOUT, 30); \/\/timeout after 30 seconds\r\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\r\ncurl_setopt($ch, CURLOPT_USERPWD, $username.':'.$password );\r\ncurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\r\n$result = curl_exec ($ch);\r\n$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); \/\/get status code\r\ncurl_close ($ch);<\/pre>\n<p>--<\/p>\n<h2>Timeout \u4ee5\u53ca\u53d6\u5f97 Timeout \u932f\u8aa4<\/h2>\n<ul>\n<li><a href=\"https:\/\/blog.longwin.com.tw\/2014\/07\/php-get-curl-timeout-status-2014\/\" target=\"_blank\" rel=\"noopener\">PHP \u5982\u4f55\u6293 CURL TIMEOUT \u7684\u72c0\u614b\u503c<\/a><\/li>\n<\/ul>\n<pre class=\"lang:default decode:true\">&lt;?php\r\n$url = '';\r\n$JsonPost = '';\r\n\r\n$ch = curl_init();\r\ncurl_setopt($ch, CURLOPT_URL, $url);\r\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $JsonPost);\r\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER , 1);\r\ncurl_setopt($ch, CURLOPT_TIMEOUT, 10);\r\n$Response = curl_exec($ch);\r\n\r\nif (curl_errno($ch) == 28){\r\n    echo '\u4e3b\u6a5f\u7121\u6cd5\u9023\u63a5\uff0c\u8acb\u7a0d\u5f8c\u91cd\u65b0\u6e2c\u8a66\uff01';\r\n}\r\nelse{\r\n    echo $Response;\r\n}\r\n\r\ncurl_close($ch);<\/pre>\n<p>--<\/p>\n<h2>\u4e0a\u50b3\u6a94\u6848 PHP 5.4 \u4ee5\u4e0b<\/h2>\n<p>\u5c07\u6a94\u6848\u5b58\u653e\u8def\u5f91\u7684\u6a94\u6848\u540d\u7a31\u524d\u52a0\u4e0a @ \u5373\u53ef<\/p>\n<pre class=\"lang:php decode:true \">\/\/ curl\r\n$url = $DocServer.'\/DocSharing\/fileUploadForeign';\r\n\r\n$post = array(\r\n    'siteId' =&gt; xuedianyun_siteId,\r\n    'timestamp' =&gt; $timestamp,\r\n    'convertTools' =&gt; 'msoffice',\r\n    'authId' =&gt; $authId,\r\n    'createUserName' =&gt; 'hoyo',\r\n    'createUserID' =&gt; 'hoyo',\r\n    'upfile' =&gt; '@1-2.ppt'\r\n);\r\n\r\n$ch = curl_init();\r\ncurl_setopt($ch, CURLOPT_URL, $url);\r\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\r\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER , 1);\r\n$Response = curl_exec($ch);\r\ncurl_close($ch);<\/pre>\n<p>--<\/p>\n<h2>\u4e0a\u50b3\u6a94\u6848 PHP 5.5 \u4ee5\u4e0a<\/h2>\n<ul>\n<li><a class=\"question-hyperlink\" href=\"https:\/\/stackoverflow.com\/questions\/25934128\/curl-file-uploads-not-working-anymore-after-upgrade-from-php-5-5-to-5-6\" target=\"_blank\" rel=\"noopener\">cURL file uploads not working anymore after upgrade from PHP 5.5 to 5.6<\/a><\/li>\n<\/ul>\n<pre class=\"lang:php decode:true\">&lt;?php\r\n$aPost = array(\r\n    'default_file' =&gt; 'html_version.html',\r\n    'expiration' =&gt; (2*31*24*60*60)\r\n)\r\nif ((version_compare(PHP_VERSION, '5.5') &gt;= 0)) {\r\n    $aPost['file'] = new CURLFile($localFile);\r\n    curl_setopt($ch, CURLOPT_SAFE_UPLOAD, true);\r\n} else {\r\n    $aPost['file'] = \"@\".$localFile;\r\n}\r\n\r\n$ch = curl_init();\r\ncurl_setopt($ch, CURLOPT_URL, $apiurl);\r\ncurl_setopt($ch, CURLOPT_TIMEOUT, 120);\r\ncurl_setopt($ch, CURLOPT_BUFFERSIZE, 128);\r\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $aPost);\r\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n$sResponse = curl_exec ($ch);<\/pre>\n<p>\u5982\u8981\u6cbf\u7528 5.4 \u820a\u65b9\u6cd5\u5247\u8a2d\u5b9a\u00a0curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); \u5373\u53ef<\/p>\n<p>--<\/p>\n<h2>HTTP 417 - Expectation Failed<\/h2>\n<ul>\n<li><a href=\"https:\/\/gist.github.com\/perusio\/1724301\" target=\"_blank\" rel=\"noopener\">Workaround in PHP cURL for the 100-continue expectation<\/a><\/li>\n<\/ul>\n<pre class=\"lang:php decode:true \">curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));<\/pre>\n<p>--<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"3036\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;29,887&nbsp;total views<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>-- PHP curl \u6703\u6709\u4e0d...<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"3036\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;29,887&nbsp;total views<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[260],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/3036"}],"collection":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3036"}],"version-history":[{"count":20,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/3036\/revisions"}],"predecessor-version":[{"id":13889,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/3036\/revisions\/13889"}],"wp:attachment":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}