跟着老师代码,用户关注还是没有收到推送消息两个问题(附代码)
跟着老师代码,用户关注还是无法收到推送的有两个原因
$GLOBALS['HTTP_RAW_POST_DATA'];函数php版本废除
simplexml_load_string($postArr);//少了两个参数,可能是微信后台参数有变
解决办法:
用file_get_contents("php://input")替换$GLOBALS['HTTP_RAW_POST_DATA'];
用simplexml_load_string($postArr,'SimpleXMLElement', LIBXML_NOCDATA)替换simplexml_load_string($postArr);