我想知道如何从以下代码获得的html结果中获取消息值:
$rawPostData = file_get_contents('php://input');
var_dump($rawPostData);
HTML结果
string(366) "------------------------------b8059a4b17b3 Content-Disposition: form-data; name="message" title ------------------------------b8059a4b17b3 Content-Disposition: form-data; name="userid" userid ------------------------------b8059a4b17b3 Content-Disposition: form-data; name="date" January 21, 2013, 1:16 am ------------------------------b8059a4b17b3-- " "
答案 0 :(得分:1)
解决方案:
卷曲中的:
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($postarray));
在你的api脚本中:
$rawPostData = file_get_contents('php://input');
parse_str($rawPostData,$rr);
var_dump($rr['message']);