微信消息推送中换行和超链接的使用

时间:2017-10-11 19:15:57   收藏:0   阅读:378
if($postObj->Event == ‘CLICK‘ && $postObj->EventKey == ‘tel‘){
                $toUser = $postObj->FromUserName;
                $fromUser = $postObj->ToUserName;
                $time = time();
                $Msgtype = ‘text‘;
                //$Content = $postObj->FromUserName;
                $Content = "如果您想通过APP解决问题,可以打开陪它APP,点击设置中心的问题反馈即可将您的问题及时反馈给我们。\n\n 如果您想咨询电话客服,可以拨打400-902-7011(服务时间:9:00-18:00) \n\n 此外,您可以填写APP上的问卷调查帮助我们更好的改善APP功能。<a href=‘https://www.peita.net‘>进入官网</a>";
                $template = "<xml>
                            <ToUserName><![CDATA[%s]]></ToUserName>
                            <FromUserName><![CDATA[%s]]></FromUserName>
                            <CreateTime>%s</CreateTime>
                            <MsgType><![CDATA[%s]]></MsgType>
                            <Content><![CDATA[%s]]></Content>
                            </xml>";
                $info = sprintf($template,$toUser,$fromUser,$time,$Msgtype,$Content);
                echo $info;
            }

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!