之前一直用Thinkphp导致都不会原生的PHP了,有个小点遗漏了。 PHP获取POST的原始数据:
$post=file_get_contents("php://input");
这句就是获取原始数据格式,是字符串形式的。 如果是JSON格式的话可以使用 $poa=json_decode($post,true); 来吧string转换为array
$poa=json_decode($post,true);
要发表评论,您必须先登录。
Rat’s Blog