wxapi/weixin.class.php

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

class Weixin

{

    public $token = '';//token

    public $debug =  false;//是否debug的状态标示,方便我们在调试的时候记录一些中间数据

    public $setFlag = false;

    public $msgtype = 'text';   //('text','image','location')

    public $msg = array();

 

    public function __construct($token,$debug)

    {

        $this->token = $token;

        $this->debug = $debug;

    }

//获得用户发过来的消息(消息内容和消息类型  )

    public function getMsg()

    {

        $postStr = $GLOBALS["HTTP_RAW_POST_DATA"];

        if ($this->debug) {

                        $this->write_log($postStr);

        }

        if (!empty($postStr)) {

            $this->msg = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);

            $this->msgtype = strtolower($this->msg['MsgType']);

        }

    }

//回复文本消息

    public function makeText($text='')

    {

        $CreateTime = time();

后面还有 233 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。