刚用ThinkPHP 一个截取字符串函数 但是模板里却输不出来代码:
$news_list = $model_list->findall('',$fields,'dateline desc',$p->firstRow.','.$p->listRows);
/*截取字符串*/
foreach ($news_list as $x=>$y) {
$news_list[$x]['content']=cut_str(Zmor_ireplace($y['content']),30,0,"UTF-8"); //截取字符串函数
} //模板输出
$page = $p->show();
$this->assign('news_list',$news_list);
$news_list = $model_list->findall('',$fields,'dateline desc',$p->firstRow.','.$p->listRows);
/*截取字符串*/
foreach ($news_list as $x=>$y) {
$news_list[$x]['content']=cut_str(Zmor_ireplace($y['content']),30,0,"UTF-8"); //截取字符串函数
} //模板输出
$page = $p->show();
$this->assign('news_list',$news_list);
试下