用默認get方式傳遞的時候,接收方式沒有改變,仍然是$_GET。
但是用post方式傳遞數據的時候,用$_POST無法接收數據,應為小程序默認post發送的content-type為application/json,並非傳統的那兩種。具體參見下面兩篇文章。
https://blog.csdn.net/cominglately/article/details/80393335
https://www.cnblogs.com/CyLee/p/7644380.html
結論:用get傳遞,照舊。
用post傳遞,接收使用$request_body = $GLOBALS['HTTP_RAW_POST_DATA'])或者$request_body = file_get_contents('php://input');