ThinkPHP 截取字符串问题
刚用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[$x]['content']=msubstr(Zmor_ireplace($y['content']),0,30,"UTF-8");
试下
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号