我的輸不出圖文消息,而且一直報錯:該公眾號提供的服務(wù)出現(xiàn)故障,請稍后再試
$arr = array(
array(
'title'=>"掃福",
'description'=>"給你發(fā)個福字",
'picurl'=>"http://idcbgp.cn/static/img/common/logo.png",
'url'=>"https://www.baidu.com",
),
);
$template = "<xml>
<ToUserName><![CDATA[%s]]></ToUserName>
<FromUserName><![CDATA[%s]]></FromUserName>
<CreateTime>%u</CreateTime>
<MsgType><![CDATA[%s]]></MsgType>
<ArticleCount>".count($arr)."</ArticleCount>
<Articles>";
foreach ($arr as $val){
$template .= "<item>
? <Title><![CDATA[".$val['title']."]]></Title>
? <Description><![CDATA[".$val['description']."]]></Description>
? <PicUrl><![CDATA[".$val['picurl']."]]></PicUrl>
? <Url><![CDATA[".$val['url']."]]></Url>
? </item>";
}
$template .= "</Articles>
? </xml>";
$template = trim($template);
$info = sprintf($template,$toUsername,$fromUserName,$time,'news');
echo $info;
2018-02-11
<CreateTime>%u</CreateTime>,?? 這里是%s ,代表字符串?? 對應(yīng)的? $time