微信公众平台开发接口PHP SDK完整版_PHP教程
程序员文章站
2022-05-10 18:14:20
...
官方提供的SDK只有一个文本消息功能,我们将所有消息的消息类型及事件响应都整理了进来,并且加入日志记录,代码如下:
("TOKEN", "weixin"
= (!(['echostr' -> } ->
= ["echostr" (->
= ["signature" = ["timestamp" = ["nonce" = = (, , (, = ( = (
( == }
= ["HTTP_RAW_POST_DATA" (!( ->logger("R ". = (, 'SimpleXMLElement', = (->
( "event":
= ->receiveEvent( "text":
= ->receiveText( "image":
= ->receiveImage( "location":
= ->receiveLocation( "voice":
= ->receiveVoice( "video":
= ->receiveVideo( "link":
= ->receiveLink( :
= "unknow msg type: ".