Dedehtml.com

php汉字字符串中间插入换行符

摘要:php汉字字符串中间插入换行符

function strsub($str)
{
	$str_count	=	mb_strlen($str,'utf-8');
	$mid		=	ceil($str_count/2);
    return mb_substr($str,0,$mid,'utf-8')."<br/>".mb_substr($str,$mid,$str_count,'utf-8');
}
版权声明:本文为博主原创文章,未经博主允许不得转载。https://www.dedehtml.com/help/php-string-br.html
(1)
打赏 微信扫一扫 微信 支付宝 QQ 扫码打赏