我想從執行cUrl發佈請求後得到的響應中得到來自json數組的「標記」的值。在print_r($response);
之後它打印出所有這些。但我只想使用json字符串和一個特定的值。從cURL獲取沒有標題的json響應的值
這是我的迴應。我不希望所有這些在響應之前
HTTP/1.1 200 OK<br/>
Content-Type: application/json<br/>
Content-Length: 312<br/>
Connection: keep-alive<br/>
Vary: Accept-Encoding<br/>
Status: 200 OK<br/>
Cache-Control: max-age=0, private, must-revalidate<br/>
Date: Wed, 22 Mar 2017 12:52:25 GMT<br/>
Strict-Transport-Security: max-age=31536000<br/>
X-Request-Id: 9418df03bea4e4884522b703d0eec504<br/>
X-UA-Compatible: IE=Edge,chrome=1<br/>
ETag: "dd4de4d3a6e4e499d6a034ce784d2d76"<br/>
X-Runtime: 0.633173<br/>
X-Content-Type-Options: nosniff<br/>
X-Rack-Cache: invalidate, pass<br/>
X-Powered-By: Phusion Passenger 5.0.28<br/>
Server: nginx/1.10.0 + Phusion Passenger 5.0.28
{"response_code":"00","response_text":"Mobile wallet payment request has been issued.","description":"You will receive a bill prompt shortly on your number 0546653444 with invoice no. 201562656, kindly complete it.","transaction_id":"DTV408402","token":"8268dfffa46a16b0665a76","mobile_invoice_no":"201562656"}
什麼是你使用,你怎麼想去做 ??給一些想法。 –
'curl_setopt($ ch,CURLOPT_HEADER,0);' – AbraCadaver
@AbraCadaver,非常感謝喲,將它添加到答案中,以便我可以將您的答案作爲正確答案投票。 –