ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
1.图文回复 ~~~ public function response_text($fromUsername, $toUsername) { $textTpl = "<xml> <ToUserName><![CDATA[%s]]></ToUserName> <FromUserName><![CDATA[%s]]></FromUserName> <CreateTime>%s</CreateTime> <MsgType><![CDATA[%s]]></MsgType> <ArticleCount>%s</ArticleCount> %s </xml>"; $count=1; $str="<Articles> <item> <Title>< ![CDATA[壹城好店!] ]></Title> <Description>< ![CDATA[同城美食,家居,时尚,健身,教育.....咨询平台] ]></Description> <PicUrl>< ![CDATA[http://admin.nineopen.com:8000/uploads/banner/20180708/5bdd6e995e52d665c6486529c1bf8188.jpg] ]></PicUrl> <Url>< ![CDATA[http://www.nineopen.com] ]></Url> </item> </Articles>"; $msgType = "news"; $time =time(); $resultStr = sprintf($textTpl,$toUsername,$fromUsername, $time, $msgType,$count,$str); echo $resultStr; } ~~~