//phpwind 里边关于字符串分割的函数
function substrs($content,$length)
{
global $db_charset;
if($length && strlen($content)>$length)
{
if($db_charset!='utf-8')
{
$retstr='';
for($i = 0; $i < $length - 2; $i++)
{
$retstr .= ord($content[$i]) > 127 ? $content[$i].$content[++$i] : $content[$i];
}
return $retstr.' ..';
}
else
{
return utf8_trim(substr($content,0,$length)).' ..';
}
}
return $content;
}
function substrs($content,$length)
{
global $db_charset;
if($length && strlen($content)>$length)
{
if($db_charset!='utf-8')
{
$retstr='';
for($i = 0; $i < $length - 2; $i++)
{
$retstr .= ord($content[$i]) > 127 ? $content[$i].$content[++$i] : $content[$i];
}
return $retstr.' ..';
}
else
{
return utf8_trim(substr($content,0,$length)).' ..';
}
}
return $content;
}
解决方案 »
- php?action=中是用switch还是if???
- 坐等simplexml_load_file解析xml问题?怎么便利出child下的内容
- 【求助】PHP的Switch语句case无法选择
- 关于php/mysql网页中重复提交的几个问题?(需要的是php版的!)
- 要疯了,弄了好几个小时eclipse还是无法高亮显示html或者xsl
- 碰到一个js问题,不知怎么回事,请指教!!!!
- 新的一年,老的问题. 强烈要求各位高手前来帮忙,并祝大家新年快乐,万事如意
- 用PHP制作"文档管理系统"的一个小问题!!!!!!!
- 如何做到用户用邮件用户账号也能登入我的聊天系统,就是象网易通行证那样的?
- 关于onlick事件和javascript的问题
- 使用同名checkbox的问题
- 初学php,配制php的问题,无法加载LoadModule php5_module D:\php\php5apache2.dll!!
{
global $db_charset;
if($length && strlen($content)>$length)
{
if($db_charset!='utf-8')
{
$retstr='';
for($i = 0; $i < $length - 2; $i++)
{
$retstr .= ord($content[$i]) > 127 ? $content[$i].$content[++$i] : $content[$i];
}
return $retstr.' ..';
}
else
{
return utf8_trim(substr($content,0,$length)).' ..';
}
}
return $content;
}