扫码关注官方订阅号
以前没设计过API 我想做个JSON的API,直接传递JSON过去,但是好像一定要键值对的方式传递,全文本的话$_POST接收不到东西.一定要键值对方式吗?
ringa_lee
$jsoncode = file_get_contents("php://input");$arr = array();$arr = convertUrlQuery($jsoncode);
$user_id = $arr['user_id']; $info = $arr['info']; $type =$arr['type'];
$postdata = file_get_contents("php://input");
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
$jsoncode = file_get_contents("php://input");
$arr = array();
$arr = convertUrlQuery($jsoncode);
$postdata = file_get_contents("php://input");