【发布时间】:2018-01-09 10:01:21
【问题描述】:
我使用 volley 将 json 对象发送到服务器并在服务器中获取数据,但我无法将 jason 对象转换为 php 中的数组,并且我的代码不起作用
{
"type": "get_new_products",
"city": "abhar",
"page": 0
}
php代码
<?php
$get_post = file_get_contents('php://input');
$post_data = json_decode($get_post, true);
$content_type = $post_data['type'];
echo $content_type; ?>
【问题讨论】:
-
您是否检查过您是否收到了数据?以
echo $get_post;为例。 -
这里没有一个完整的问题
-
是的,我得到数据 $get_post
标签: php android json android-volley