微信 回复多图文 借助php框架
private function replyMostPhoto($data,$arr)
{
$this->logger("已经到达回复多图文!".$arr[0]['Title']);
$itemModel="
<item>
<Title><![CDATA[%s]]></Title>
<Description><![CDATA[%s]]></Description>
<PicUrl><![CDATA[%s]]></PicUrl>
<Url><![CDATA[%s]]></Url>
</item>";
$Model_item="";//用来接收模板
foreach($arr as $item)
{
$Model_item.=sprintf($itemModel,$item['Title'],$item['Description'],$item['PicUrl'],$item['Url']);
}
$this->logger("here".$arr['Title']);
$xml=<<<php
<xml>
<ToUserName><![CDATA[%s]]></ToUserName>
<FromUserName><![CDATA[%s]]></FromUserName>
<CreateTime>%s</CreateTime>
<MsgType><![CDATA[news]]></MsgType>
<ArticleCount>%s</ArticleCount>
<Articles>
$Model_item
</Articles>
</xml>
php;
$this->logger($xml);
echo sprintf($xml,$data['FromUserName'],$data['ToUserName'],$data['time()'],count($arr));
}
最新文章
- Python黑帽编程1.3 Python运行时与包管理工具
- Windows中explorer(图形壳)
- 开始学习c语言
- PDF的信息表达原理及特点分析
- BigInteger在Java8中的改进
- (35)odoo中widget
- GDB代码调试与使用
- 项目笔记---Socket Error Code翻译
- window的画图工具(mspaint)也可以帮助我们开发和调试代码的.
- 文件下载,带转码-&;gt;pdf-&;gt;swf
- PHP之CI框架架设错误--Only variable references should be returned by reference
- 开始QT+OpenCV学问
- this is it
- 使用virsh搭建虚拟机管理环境
- Quill编辑器介绍及扩展
- 手机端rem如何适配_rem详解及使用方法
- Unity 使用TexturePackerGUI打包图集 Sprite 图片边上有线
- (后端)项目中的错误之java中判断字符里面含有某些字符
- 中国移动物联网ONENET平台数据本地采集工具
- Spring 拦截器实现+后台原理(MethodInterceptor)
热门文章
- cf C. Inna and Dima
- 设计模式(六):Singleton 单件模式 -- 创建型模式
- 【转】Java 中字符串的格式化
- Linux 下 的 cc 和 gcc
- Introduction to Web Services
- 《Linear Algebra and Its Applications》-chaper2-矩阵的逆
- C++ Template Specialization (模板特化)
- mysql oracle静默 一键安装脚本
- windows server 2003 64x 读取office数据终极解决办法 The &#39;Microsoft.Jet.OLEDB.4.0&#39; provider is not registered
- UVa 10025: The ? 1 ? 2 ? ... ? n = k problem