09
Mar
function LeftTrue($str,$n,$str2,$m,$type)
{
$l=strlen($str);
$TStr="";
$t=0;
for ($i=0; $i<$l; $i++)
{
$c=ord(substr($str,$i,1));
if ($c<0)
$c=$c+65536;
if
($c>127) {
$t+=2;
$TStr=$TStr.(substr($str,$i,2));
$i++;
}else
{
$t++;
$TStr=$TStr.(substr($str,$i,1));
}
if
($t>=$n)
break;
}
if($t>=$n || !$type)
{
$function_ret=$TStr.str_repeat($str2,$n+$m-$t);
}else
{
$function_ret=$TStr;
for($i=$t;$i<$n+$m;$i++)
$function_ret.=" ";
}
return
$function_ret;
}













发表评论
字体为 粗体 是必填项目,邮箱地址 永远不会 公布。
允许部分 HTML 代码:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>URIs must be fully qualified (eg: http://shunz.net/) and all tags must be properly closed.
超出部分系统将会自动分段及换行。
请保证评论内容是与日志或 Blog 内容相关的,灌水、攻击性或不恰当的评论 may 会被编辑或删除。