自动回复图文

 

 

case '成都': //
                    $content = array();
                    $content[] = array("Title" =>"现场直播|xxxxxxxx峰会-成都",
                        "Description" =>"xxxxxx高端盛宴",
                        "PicUrl" =>"http://xxx.xxx.com/files/user/fenghui/meeting/img/chengdu.png?20190313",
                        "Url" =>"https://xxx.xxx.com/live/5534154?openid=".$postObj->FromUserName);
                    $this->transmitNews($postObj, $content);
                    exit();
                    break;






   private function transmitNews($object, $newsArray)
    {
        if(!is_array($newsArray)){
            return;
        }
        $itemTpl = "    
        <![CDATA[%s]]>
        
        
        
    
";
        $item_str = "";
        foreach ($newsArray as $item){
            $item_str .= sprintf($itemTpl, $item['Title'], $item['Description'], $item['PicUrl'], $item['Url']);
        }
        $xmlTpl = "


%s

%s

$item_str
";

        $result = sprintf($xmlTpl, $object->FromUserName, $object->ToUserName, time(), count($newsArray));
        //return $result;
        echo $result;die();

    }



 

你可能感兴趣的:(微信)