Table of Contents
1. Definition of graphic messages
二、图文消息的实现
三、图文消息的类型
四、图文消息的回复
Home Backend Development PHP Tutorial WeChat public platform development (97) Graphic message_PHP tutorial

WeChat public platform development (97) Graphic message_PHP tutorial

Jul 13, 2016 am 10:27 AM
Development tutorial WeChat development

Keywords: WeChat public platform Development modelGraphic and text messages
Author: Fangbei Studio
Original text: http://www.cnblogs .com/txw1958/p/weixin-97-news.html

In this WeChat public platform development tutorial, we will introduce how to flexibly use the image and text messaging function. We will only introduce graphic messages in passive reply messages. The graphic messages sent by customer service messages and advanced group messaging interfaces are basically the same as the graphic messages introduced in this article.

This article is divided into the following four parts:

1. Definition of graphic messages

In the WeChat public platform message, the XML structure of the graphic message in the passive response message is as follows.

<span><</span><span>xml</span><span>></span>
    <span><</span><span>ToUserName</span><span>></span><span><![CDATA[</span><span>toUser</span><span>]]></span><span></</span><span>ToUserName</span><span>></span>
    <span><</span><span>FromUserName</span><span>></span><span><![CDATA[</span><span>fromUser</span><span>]]></span><span></</span><span>FromUserName</span><span>></span>
    <span><</span><span>CreateTime</span><span>></span>12345678<span></</span><span>CreateTime</span><span>></span>
    <span><</span><span>MsgType</span><span>></span><span><![CDATA[</span><span>news</span><span>]]></span><span></</span><span>MsgType</span><span>></span>
    <span><</span><span>ArticleCount</span><span>></span>2<span></</span><span>ArticleCount</span><span>></span>
    <span><</span><span>Articles</span><span>></span>
        <span><</span><span>item</span><span>></span>
            <span><</span><span>Title</span><span>></span><span><![CDATA[</span><span>title1</span><span>]]></span><span></</span><span>Title</span><span>></span> 
            <span><</span><span>Description</span><span>></span><span><![CDATA[</span><span>description1</span><span>]]></span><span></</span><span>Description</span><span>></span>
            <span><</span><span>PicUrl</span><span>></span><span><![CDATA[</span><span>picurl</span><span>]]></span><span></</span><span>PicUrl</span><span>></span>
            <span><</span><span>Url</span><span>></span><span><![CDATA[</span><span>url</span><span>]]></span><span></</span><span>Url</span><span>></span>
        <span></</span><span>item</span><span>></span>
        <span><</span><span>item</span><span>></span>
            <span><</span><span>Title</span><span>></span><span><![CDATA[</span><span>title</span><span>]]></span><span></</span><span>Title</span><span>></span>
            <span><</span><span>Description</span><span>></span><span><![CDATA[</span><span>description</span><span>]]></span><span></</span><span>Description</span><span>></span>
            <span><</span><span>PicUrl</span><span>></span><span><![CDATA[</span><span>picurl</span><span>]]></span><span></</span><span>PicUrl</span><span>></span>
            <span><</span><span>Url</span><span>></span><span><![CDATA[</span><span>url</span><span>]]></span><span></</span><span>Url</span><span>></span>
        <span></</span><span>item</span><span>></span>
    <span></</span><span>Articles</span><span>></span>
<span></</span><span>xml</span><span>></span> 
Copy after login

The parameter description is as follows.

ParameterIs it necessaryExplanation
ToUserName Yes Receiver account (received OpenID)
FromUserName Yes
参数是否必须说明
ToUserName 接收方帐号(收到的OpenID)
FromUserName 开发者微信号
CreateTime 消息创建时间 (整型)
MsgType news
ArticleCount 图文消息个数,限制为10条以内
Articles 多条图文消息信息,默认第一个item为大图,注意,如果图文数超过10,则将会无响应
Title 图文消息标题
Description 图文消息描述
PicUrl 图片链接,支持JPG、PNG格式,较好的效果为大图360*200,小图200*200
Url 点击图文消息跳转链接
Developer<🎜>WeChat ID
CreateTime Yes Message creation time (integer)
MsgType Yes news
ArticleCount Yes The number of graphic and text messages is limited to 10 messages
Articles Yes For multiple graphic and text messages, the first item is a large image by default. Note that if the number of graphic and text messages exceeds 10, there will be no response
Title No Picture and text message title
Description No Picture and text message description
PicUrl No Image link supports JPG and PNG formats. The best effect is 360*200 for large images and 200*200 for small images
Url No Click on the graphic message to jump to the link

从中可以知道,图文消息的类型为news,图文消息个数最大为10(注意在编辑模式中,可以设置最大条数为8)。超过10条,微信将不再响应。

多图文消息中会有大图和小图的区别,第一个item中的图片为大图,其他item中的图片为小图。

二、图文消息的实现

根据上述定义,我们定义图文消息的回复代码实现如下:

    <span>//</span><span>回复图文消息</span>
    <span>private</span> <span>function</span> transmitNews(<span>$object</span>, <span>$newsArray</span><span>)
    {
        </span><span>if</span>(!<span>is_array</span>(<span>$newsArray</span><span>)){
            </span><span>return</span><span>;
        }
        </span><span>$itemTpl</span> = "<span>    <item>
        <Title><![CDATA[%s]]></Title>
        <Description><![CDATA[%s]]></Description>
        <PicUrl><![CDATA[%s]]></PicUrl>
        <Url><![CDATA[%s]]></Url>
    </item>
</span>"<span>;
        </span><span>$item_str</span> = ""<span>;
        </span><span>foreach</span> (<span>$newsArray</span> <span>as</span> <span>$item</span><span>){
            </span><span>$item_str</span> .= <span>sprintf</span>(<span>$itemTpl</span>, <span>$item</span>['Title'], <span>$item</span>['Description'], <span>$item</span>['PicUrl'], <span>$item</span>['Url'<span>]);
        }
        </span><span>$xmlTpl</span> = "<span><xml>
<ToUserName><![CDATA[%s]]></ToUserName>
<FromUserName><![CDATA[%s]]></FromUserName>
<CreateTime>%s</CreateTime>
<MsgType><![CDATA[news]]></MsgType>
<ArticleCount>%s</ArticleCount>
<Articles>
</span><span>$item_str</span><span></Articles>
</xml></span>"<span>;

        </span><span>$result</span> = <span>sprintf</span>(<span>$xmlTpl</span>, <span>$object</span>->FromUserName, <span>$object</span>->ToUserName, <span>time</span>(), <span>count</span>(<span>$newsArray</span><span>));
        </span><span>return</span> <span>$result</span><span>;
    }</span>
Copy after login

上述代码中,先将各item连接形成item_str,再将item_str赋值到xml模板中,组装一个图文消息。组装时,将object中的发送、接收方互换位置,计算出图文项的个数。

而在构造图文消息并使用图文回复的代码如下所示

<span>if</span> (<span>strstr</span>(<span>$keyword</span>, "单图文"<span>)){
    </span><span>$content</span> = <span>array</span><span>();
    </span><span>$content</span>[] = <span>array</span>("Title"=>"单图文标题",  "Description"=>"单图文内容", "PicUrl"=>"http://discuz.comli.com/weixin/weather/icon/cartoon.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958"<span>);
}</span><span>else</span> <span>if</span> (<span>strstr</span>(<span>$keyword</span>, "图文") || <span>strstr</span>(<span>$keyword</span>, "多图文"<span>)){
    </span><span>$content</span> = <span>array</span><span>();
    </span><span>$content</span>[] = <span>array</span>("Title"=>"多图文1标题", "Description"=>"", "PicUrl"=>"http://discuz.comli.com/weixin/weather/icon/cartoon.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958"<span>);
    </span><span>$content</span>[] = <span>array</span>("Title"=>"多图文2标题", "Description"=>"", "PicUrl"=>"http://d.hiphotos.bdimg.com/wisegame/pic/item/f3529822720e0cf3ac9f1ada0846f21fbe09aaa3.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958"<span>);
    </span><span>$content</span>[] = <span>array</span>("Title"=>"多图文3标题", "Description"=>"", "PicUrl"=>"http://g.hiphotos.bdimg.com/wisegame/pic/item/18cb0a46f21fbe090d338acc6a600c338644adfd.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958"<span>);
}

</span><span>if</span>(<span>is_array</span>(<span>$content</span><span>)){
    </span><span>if</span> (<span>isset</span>(<span>$content</span>[0]['PicUrl'<span>])){
        </span><span>$result</span> = <span>$this</span>->transmitNews(<span>$object</span>, <span>$content</span><span>);
    }</span><span>else</span> <span>if</span> (<span>isset</span>(<span>$content</span>['MusicUrl'<span>])){
        </span><span>$result</span> = <span>$this</span>->transmitMusic(<span>$object</span>, <span>$content</span><span>);
    }
}</span><span>else</span><span>{
    </span><span>$result</span> = <span>$this</span>->transmitText(<span>$object</span>, <span>$content</span><span>);
}</span>
Copy after login

一个完整的体验代码可参考 微信公众平台开发接口PHP SDK完整版

三、图文消息的类型

图文消息从item的个数上来分,可以分为单图文消息和多图文消息,其中单图文消息中item数为1,多图文消息中item数从2~10都包括。

虽然图文消息只有两种类型,但其实可以通过设置不同的参数构造出更多的展示效果。

单图文消息

单图文消息就是一个图文消息。

下面代码定义一个基本的图文消息

<span>$content</span> = <span>array</span><span>();
</span><span>$content</span>[] = <span>array</span>("Title" =>"大学英语四六级成绩查询", 
                   "Description" =>"点击图片进入", 
                   "PicUrl" =>"http://365jia.cn/uploads/13/0301/5130c2ff93618.jpg", 
                   "Url" =>"http://israel.sinaapp.com/cet/index.php?openid=".<span>$object</span>->FromUserName);
Copy after login

它的回复效果如图所示。其特点是标题粗体显示,内容字体则为灰色显示,如果有图片,则同时显示日期。

再看一下不定义图片和链接时的情况,代码如下

<span>$aqiArray</span> = <span>array</span><span>(); 
</span><span>$aqiArray</span>[] = <span>array</span>("Title" =><span>$cityAir</span>[0]['area']."空气质量", 
                    "Description" =>"空气质量指数(AQI):".<span>$cityAir</span>[0]['aqi']."\n".
                                    "空气质量等级:".<span>$cityAir</span>[0]['quality']."\n".
                                    "细颗粒物(PM2.5):".<span>$cityAir</span>[0]['pm2_5']."\n".
                                    "可吸入颗粒物(PM10):".<span>$cityAir</span>[0]['pm10']."\n".
                                    "一氧化碳(CO):".<span>$cityAir</span>[0]['co']."\n".
                                    "二氧化氮(NO2):".<span>$cityAir</span>[0]['no2']."\n".
                                    "二氧化硫(SO2):".<span>$cityAir</span>[0]['so2']."\n".
                                    "臭氧(O3):".<span>$cityAir</span>[0]['o3']."\n".
                                    "更新时间:".<span>preg_replace</span>("/([a-zA-Z])/i", " ", <span>$cityAir</span>[0]['time_point'<span>]); 
                    </span>"PicUrl" =>"", 
                    "Url" =>"");
Copy after login

其效果如下所示。

可以看到,这时,由于没有图片,所以也不显示日期了,另外没有带链接,所以“查看全文”也不显示了。

多图文

多图文消息一个最大的特点就是:描述内容不会在返回中显示,所以没有必要定义描述了。

下面是一个基本的多图文消息的定义

 <span>$content</span> = <span>array</span><span>();
</span><span>$content</span>[] = <span>array</span>("Title"=>"多图文1标题", "Description"=>"", "PicUrl"=>"http://discuz.comli.com/weixin/weather/icon/cartoon.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958"<span>);
</span><span>$content</span>[] = <span>array</span>("Title"=>"多图文2标题", "Description"=>"", "PicUrl"=>"http://d.hiphotos.bdimg.com/wisegame/pic/item/f3529822720e0cf3ac9f1ada0846f21fbe09aaa3.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958"<span>);
</span><span>$content</span>[] = <span>array</span>("Title"=>"多图文3标题", "Description"=>"", "PicUrl"=>"http://g.hiphotos.bdimg.com/wisegame/pic/item/18cb0a46f21fbe090d338acc6a600c338644adfd.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958");
Copy after login

其实现效果如下

如果觉得首图太大,占地方,也可以不填写。

比如这样的代码

<span>$content</span> = <span>array</span><span>(); 
</span><span>$content</span>[] = <span>array</span>("Title" =>"微信公众平台开发教程", "Description" =>"", "PicUrl" =>"", "Url" =>""<span>);
</span><span>$content</span>[] = <span>array</span>("Title" =>"【基础入门】免费\n1. 申请服务器资源\n2. 启用开发模式\n3. 消息类型详解\n4. 获取接收消息\n5. 回复不同消息", "Description" =>"", "PicUrl" =>"http://e.hiphotos.bdimg.com/wisegame/pic/item/9e1f4134970a304e1e398c62d1c8a786c9175c0a.jpg", "Url" =>"http://m.cnblogs.com/99079/3153567.html?full=1"<span>);
</span><span>$content</span>[] = <span>array</span>("Title" =>"【初级教程】双11六折促销\n1.小黄鸡机器人\n2.英语类公众账号开发", "Description" =>"", "PicUrl" =>"http://g.hiphotos.bdimg.com/wisegame/pic/item/3166d0160924ab186196512537fae6cd7b890b24.jpg", "Url" =>"http://israel.duapp.com/taobao/index.php?id=1");
Copy after login

其效果如下所示

WeChat public platform development (97) Graphic message_PHP tutorial$content = array(); $content[] = array("Title" =>"欢迎关注方倍工作室","Description" =>"", "PicUrl" =>"", "Url" =>""); $content[] = array("Title" =>"【1】新闻 天气 空气 股票 彩票 星座\n". "【2】快递 人品 算命 解梦 附近 苹果\n". "【3】公交 火车 汽车 航班 路况 违章\n". "【4】翻译 百科 双语 听力 成语 历史\n". "【5】团购 充值 菜谱 贺卡 景点 冬吴\n". "【6】情侣相 夫妻相 亲子相 女人味\n". "【7】相册 游戏 笑话 答题 点歌 树洞\n". "【8】微社区 四六级 华强北 世界杯\n\n". "更多精彩,即将亮相,敬请期待!";, "Description" =>"", "PicUrl" =>"", "Url" =>""); $content[] = array("Title" =>"回复对应数字查看使用方法\n发送 0 返回本菜单", "Description" =>"", "PicUrl" =>"", "Url" =>"");

其效果如下所示

四、图文消息的回复

因为图文消息有更好的视觉效果,很多朋友都想要实现图文消息的回复。主要有以下几种情况

1. 关注时回复图文消息

放到订阅事件下就行了,代码如下

    <span>//</span><span>接收事件消息</span>
    <span>private</span> <span>function</span> receiveEvent(<span>$object</span><span>)
    {
        </span><span>$content</span> = ""<span>;
        </span><span>switch</span> (<span>$object</span>-><span>Event)
        {
            </span><span>case</span> "subscribe":
                <span>$content</span> = <span>array</span><span>();
                </span><span>$content</span>[] = <span>array</span>("Title"=>"多图文1标题", "Description"=>"", "PicUrl"=>"http://discuz.comli.com/weixin/weather/icon/cartoon.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958"<span>);
                </span><span>$content</span>[] = <span>array</span>("Title"=>"多图文2标题", "Description"=>"", "PicUrl"=>"http://d.hiphotos.bdimg.com/wisegame/pic/item/f3529822720e0cf3ac9f1ada0846f21fbe09aaa3.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958"<span>);
                </span><span>$content</span>[] = <span>array</span>("Title"=>"多图文3标题", "Description"=>"", "PicUrl"=>"http://g.hiphotos.bdimg.com/wisegame/pic/item/18cb0a46f21fbe090d338acc6a600c338644adfd.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958"<span>);
                </span><span>break</span><span>;
            </span><span>case</span> "unsubscribe":
                <span>$content</span> = "取消关注"<span>;
                </span><span>break</span><span>;
        }
        </span><span>if</span>(<span>is_array</span>(<span>$content</span><span>)){
            </span><span>if</span> (<span>isset</span>(<span>$content</span>[0<span>])){
                </span><span>$result</span> = <span>$this</span>->transmitNews(<span>$object</span>, <span>$content</span><span>);
            }</span><span>else</span> <span>if</span> (<span>isset</span>(<span>$content</span>['MusicUrl'<span>])){
                </span><span>$result</span> = <span>$this</span>->transmitMusic(<span>$object</span>, <span>$content</span><span>);
            }
        }</span><span>else</span><span>{
            </span><span>$result</span> = <span>$this</span>->transmitText(<span>$object</span>, <span>$content</span><span>);
        }

        </span><span>return</span> <span>$result</span><span>;
    }</span>
Copy after login

2. 发送关键字回复图文消息

通过判断关键字既可实现,

<span>//</span><span>接收文本消息</span>
<span>private</span> <span>function</span> receiveText(<span>$object</span><span>)
{
    </span><span>$keyword</span> = <span>trim</span>(<span>$object</span>-><span>Content);
    </span><span>if</span> (<span>strstr</span>(<span>$keyword</span>, "单图文"<span>)){
        </span><span>$content</span> = <span>array</span><span>();
        </span><span>$content</span>[] = <span>array</span>("Title"=>"单图文标题",  "Description"=>"单图文内容", "PicUrl"=>"http://discuz.comli.com/weixin/weather/icon/cartoon.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958"<span>);
    }</span><span>else</span> <span>if</span> (<span>strstr</span>(<span>$keyword</span>, "图文") || <span>strstr</span>(<span>$keyword</span>, "多图文"<span>)){
        </span><span>$content</span> = <span>array</span><span>();
        </span><span>$content</span>[] = <span>array</span>("Title"=>"多图文1标题", "Description"=>"", "PicUrl"=>"http://discuz.comli.com/weixin/weather/icon/cartoon.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958"<span>);
        </span><span>$content</span>[] = <span>array</span>("Title"=>"多图文2标题", "Description"=>"", "PicUrl"=>"http://d.hiphotos.bdimg.com/wisegame/pic/item/f3529822720e0cf3ac9f1ada0846f21fbe09aaa3.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958"<span>);
        </span><span>$content</span>[] = <span>array</span>("Title"=>"多图文3标题", "Description"=>"", "PicUrl"=>"http://g.hiphotos.bdimg.com/wisegame/pic/item/18cb0a46f21fbe090d338acc6a600c338644adfd.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958"<span>);
    }</span><span>else</span><span>{
        </span><span>$content</span> = <span>date</span>("Y-m-d H:i:s",<span>time</span>())."\n技术支持 方倍工作室"<span>;
    }

    </span><span>if</span>(<span>is_array</span>(<span>$content</span><span>)){
        </span><span>if</span> (<span>isset</span>(<span>$content</span>[0]['PicUrl'<span>])){
            </span><span>$result</span> = <span>$this</span>->transmitNews(<span>$object</span>, <span>$content</span><span>);
        }</span><span>else</span> <span>if</span> (<span>isset</span>(<span>$content</span>['MusicUrl'<span>])){
            </span><span>$result</span> = <span>$this</span>->transmitMusic(<span>$object</span>, <span>$content</span><span>);
        }
    }</span><span>else</span><span>{
        </span><span>$result</span> = <span>$this</span>->transmitText(<span>$object</span>, <span>$content</span><span>);
    }
}</span>
Copy after login

3. 点击菜单时回复图文消息

在菜单点击事件中响应即可

<span>//</span><span>接收事件消息</span>
<span>private</span> <span>function</span> receiveEvent(<span>$object</span><span>)
{
    </span><span>$content</span> = ""<span>;
    </span><span>switch</span> (<span>$object</span>-><span>Event)
    {
        </span><span>case</span> "subscribe":
            <span>$content</span> = "欢迎关注方倍工作室 "<span>;
            </span><span>break</span><span>;
        </span><span>case</span> "CLICK":
            <span>switch</span> (<span>$object</span>-><span>EventKey)
            {
                </span><span>case</span> "COMPANY":
                    <span>$content</span> = <span>array</span><span>();
                    </span><span>$content</span>[] = <span>array</span>("Title"=>"多图文1标题", "Description"=>"", "PicUrl"=>"http://discuz.comli.com/weixin/weather/icon/cartoon.jpg", "Url" =>"http://m.cnblogs.com/?u=txw1958"<span>);
                    </span><span>break</span><span>;
                </span><span>default</span>:
                    <span>$content</span> = "点击菜单:".<span>$object</span>-><span>EventKey;
                    </span><span>break</span><span>;
            }
            </span><span>break</span><span>;
    }
    </span><span>if</span>(<span>is_array</span>(<span>$content</span><span>)){
        </span><span>if</span> (<span>isset</span>(<span>$content</span>[0<span>])){
            </span><span>$result</span> = <span>$this</span>->transmitNews(<span>$object</span>, <span>$content</span><span>);
        }</span><span>else</span> <span>if</span> (<span>isset</span>(<span>$content</span>['MusicUrl'<span>])){
            </span><span>$result</span> = <span>$this</span>->transmitMusic(<span>$object</span>, <span>$content</span><span>);
        }
    }</span><span>else</span><span>{
        </span><span>$result</span> = <span>$this</span>->transmitText(<span>$object</span>, <span>$content</span><span>);
    }

    </span><span>return</span> <span>$result</span><span>;
}</span>
Copy after login

4. 回复多个图文消息

由于回复消息一次只能回复一条,因此要回复多个图文消息,就需要使用其他接口。这需要已经认证的服务号才能拥有权限。

可以回复图文消息的接口有客服接口及高级群发接口,如果被动回复不够,就可使用客服接口来发送。

 

 

 

 

 ===========================================================

How to follow Fangbei Studio’s WeChat public platform account:
1. WeChat address book-add friend-search public account-search for “Fangbei Studio”
2. WeChat address book-add friend-search Number - enter "pondbaystudio"
3. Use WeChat to scan the QR code below

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/817469.htmlTechArticleKeywords: WeChat public platform development model graphic message Author: Fangbei Studio Original text: http://www .cnblogs.com/txw1958/p/weixin-97-news.html In this WeChat public platform development tutorial...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1670
14
PHP Tutorial
1274
29
C# Tutorial
1256
24
PHP WeChat development: How to implement message encryption and decryption PHP WeChat development: How to implement message encryption and decryption May 13, 2023 am 11:40 AM

PHP is an open source scripting language that is widely used in web development and server-side programming, especially in WeChat development. Today, more and more companies and developers are starting to use PHP for WeChat development because it has become a truly easy-to-learn and easy-to-use development language. In WeChat development, message encryption and decryption are a very important issue because they involve data security. For messages without encryption and decryption methods, hackers can easily obtain the data, posing a threat to users.

Enterprise WeChat interface docking and PHP approval application development tutorial Enterprise WeChat interface docking and PHP approval application development tutorial Jul 05, 2023 pm 05:45 PM

Enterprise WeChat interface docking and PHP approval application development tutorial Enterprise WeChat is an enterprise communication tool launched by Tencent, which provides powerful enterprise-level functions, such as organizational structure management, enterprise application management, message and address book synchronization, etc. Enterprise WeChat opens a wealth of interfaces for developers to connect and develop applications, providing more personalized and customized enterprise-level applications. This article will focus on the docking of the enterprise WeChat interface and the development of PHP approval applications. The following are detailed steps and code examples: Step 1: Create an enterprise WeChat application and obtain

Using PHP to develop WeChat mass messaging tools Using PHP to develop WeChat mass messaging tools May 13, 2023 pm 05:00 PM

With the popularity of WeChat, more and more companies are beginning to use it as a marketing tool. The WeChat group messaging function is one of the important means for enterprises to conduct WeChat marketing. However, if you only rely on manual sending, it is an extremely time-consuming and laborious task for marketers. Therefore, it is particularly important to develop a WeChat mass messaging tool. This article will introduce how to use PHP to develop WeChat mass messaging tools. 1. Preparation work To develop WeChat mass messaging tools, we need to master the following technical points: Basic knowledge of PHP WeChat public platform development Development tools: Sub

PHP WeChat development: How to implement user tag management PHP WeChat development: How to implement user tag management May 13, 2023 pm 04:31 PM

In the development of WeChat public accounts, user tag management is a very important function, which allows developers to better understand and manage their users. This article will introduce how to use PHP to implement the WeChat user tag management function. 1. Obtain the openid of the WeChat user. Before using the WeChat user tag management function, we first need to obtain the user's openid. In the development of WeChat public accounts, it is a common practice to obtain openid through user authorization. After the user authorization is completed, we can obtain the user through the following code

PHP WeChat development: How to implement voting function PHP WeChat development: How to implement voting function May 14, 2023 am 11:21 AM

In the development of WeChat public accounts, the voting function is often used. The voting function is a great way for users to quickly participate in interactions, and it is also an important tool for holding events and surveying opinions. This article will introduce you how to use PHP to implement WeChat voting function. Obtain the authorization of the WeChat official account. First, you need to obtain the authorization of the WeChat official account. On the WeChat public platform, you need to configure the API address of the WeChat public account, the official account, and the token corresponding to the public account. In the process of our development using PHP language, we need to use the PH officially provided by WeChat

Steps to implement WeChat public account development using PHP Steps to implement WeChat public account development using PHP Jun 27, 2023 pm 12:26 PM

How to use PHP to develop WeChat public accounts WeChat public accounts have become an important channel for promotion and interaction for many companies, and PHP, as a commonly used Web language, can also be used to develop WeChat public accounts. This article will introduce the specific steps to use PHP to develop WeChat public accounts. Step 1: Obtain the developer account of the WeChat official account. Before starting the development of the WeChat official account, you need to apply for a developer account of the WeChat official account. For the specific registration process, please refer to the official website of WeChat public platform

PHP WeChat development: How to implement group message sending records PHP WeChat development: How to implement group message sending records May 13, 2023 pm 04:31 PM

As WeChat becomes an increasingly important communication tool in people's lives, its agile messaging function is quickly favored by a large number of enterprises and individuals. For enterprises, developing WeChat into a marketing platform has become a trend, and the importance of WeChat development has gradually become more prominent. Among them, the group sending function is even more widely used. So, as a PHP programmer, how to implement group message sending records? The following will give you a brief introduction. 1. Understand the development knowledge related to WeChat public accounts. Before understanding how to implement group message sending records, I

PHP WeChat development: How to implement customer service chat window management PHP WeChat development: How to implement customer service chat window management May 13, 2023 pm 05:51 PM

WeChat is currently one of the social platforms with the largest user base in the world. With the popularity of mobile Internet, more and more companies are beginning to realize the importance of WeChat marketing. When conducting WeChat marketing, customer service is a crucial part. In order to better manage the customer service chat window, we can use PHP language for WeChat development. 1. Introduction to PHP WeChat development PHP is an open source server-side scripting language that is widely used in the field of Web development. Combined with the development interface provided by WeChat public platform, we can use PHP language to conduct WeChat

See all articles