--- fenglin/lib/str_process.inc.php 2004/06/28 22:55:35 1.4 +++ fenglin/lib/str_process.inc.php 2005/04/27 12:54:57 1.8 @@ -1,6 +1,6 @@ $line) { $result .= split_line($line,$prefix,$width); } @@ -56,4 +56,20 @@ function str_process($str,$prefix="",$wi return $result; } +function str_b_lines($str,$max_line=1) +{ + $result = ""; + $l = 0; + $lines = explode("\n",str_replace("\r\n","\n",$str)); + foreach($lines as $tmp => $line) + { + $result .= ($line."\r\n"); + $l += (strlen($line)/256 + 1); + if ($l >= $max_line) + break; + } + + return $result; +} + ?>