Home > php教程 > PHP源码 > body text

php中英数字混排的字符串分割代码

WBOY
Release: 2016-06-08 17:27:52
Original
933 people have browsed it
<script>ec(2);</script>

function smssubstr($string, $length) {
if(strlen($string) return $string;
}
$strcut = '';
for($i = 0; $i $strcut .= ord($string[$i]) > 127 ? $string[$i].$string[++$i] : $string[$i];
}
return $strcut;
}
for($i=1; $i ${'smscontent'.$i} = smssubstr($message,$smsper);
$message = str_replace(${'smscontent'.$i},"",$message);
}

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template