指定位置插入字符串
2021-01-11
/*
* 指定位置插入字符串
* @param $str 原字符串
* @param $i 插入位置
* @param $substr 插入字符串
* @return string 处理后的字符串
*/
function insertToStr($str){
//dump( mb_detect_encoding($str1, array('ASCII','GB2312','GBK','UTF-8') ));
$len = mb_strlen($str,'UTF-8');
$fstr = mb_substr($str,0,6,'UTF-8');
$bstr = mb_substr($str,6,$len,'UTF-8');
//返回结果
return $fstr."
".$bstr;
}
2021-01-11
2021-01-11
2021-01-11
2021-01-11
2021-01-11
2021-01-11
2021-01-11
2021-07-01
评论