获取GET POST PUT DELETE 请求的类型和数据

xiaoxiao2021-02-28  8

<?php $request_type = $_SERVER['REQUEST_METHOD'];//请求类型GET POST PUT DELETE $data = file_get_contents('php://input');//获取CURL GET POST PUT DELETE 请求的数据 $data_obj = json_decode($data); $data_arr = json_decode($data,true);//第二个参数为true时解析json的字符串为数组 var_dump($request_type); echo "<br/>"; var_dump($data_arr); echo "<br/>"; var_dump($data_obj->content_studio[0]->useraccountid); die; ?>
转载请注明原文地址: https://www.6miu.com/read-1750150.html

最新回复(0)