首页 >php教程 >php手册 >接口调用,字符串截取处理。

接口调用,字符串截取处理。

WBOY
WBOY原创
2016-09-07 12:57:59956浏览

<span style="color: #000000;"> public function index(){
        $this->assign('title','index');
        /*平台公告*/
        $curl=new CurlController();
        $data=array(
                'CmdId'=>'NewsList',
                'Token'=>'',
                'PostDetails'=>json_encode(array(
                        'nid'=>'gonggao',
                        'page'=>1,
                        'listRows'=>'5',
                )));
        $re=$curl->SendCurl($data);
        if ($re['RespCode'] === '000'){
            $re=$re['AcctDetails'];
            foreach($re as $key=>$value){
                $re[$key]['publish']=substr($re[$key]['publish'],0,10);
                $re[$key]['name']=mb_substr($re[$key]['name'],0,17,'utf-8');
            }
            //var_dump($re);
            $this->assign('news',$re);
            $this->assign('nid',$nid);
            $this->assign('id',$id);
        }</span>

 

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn