十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
public static function getParams()
{
$params = $_GET;
$params = array_merge($params, $_POST);
$contentType = empty($_SERVER['CONTENT_TYPE']) ? '' : $_SERVER['CONTENT_TYPE'];
if (empty($_POST) && false !== strpos($contentType, 'application/json')) {
$content = file_get_contents('php://input');
$params = array_merge($params, (array)json_decode($content, true));
}
return $params;
}