/[LeafOK_CVS]/fenglin/lib/str_process.inc.php
ViewVC logotype

Diff of /fenglin/lib/str_process.inc.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.10 by sysadm, Tue Mar 18 07:10:59 2025 UTC Revision 1.11 by sysadm, Mon Mar 24 05:46:49 2025 UTC
# Line 6  function split_line($str, $prefix = "", Line 6  function split_line($str, $prefix = "",
6                    
7          $result = "";          $result = "";
8          $len = strlen($str);          $len = strlen($str);
9          $prefix_len = mb_strlen($prefix, 'UTF-8');          $prefix_len = strlen($prefix);
10    
11          $lines_count = 0;          $lines_count = 0;
12    
13          $line = $prefix;          $line = $prefix;
14          $line_len = $prefix_len;          $line_len = $prefix_len;
15          for($i = 0; $i < $len && $lines_count < $lines_limit; $i++)          for ($i = 0; $i < $len && $lines_count < $lines_limit; $i++)
16          {          {
17                  $c = $str[$i];                  $c = $str[$i];
18    
# Line 69  function split_line($str, $prefix = "", Line 69  function split_line($str, $prefix = "",
69                          $line_len = $prefix_len;                          $line_len = $prefix_len;
70                  }                  }
71          }          }
72          $result .= ($line . "\n");  
73            if ($lines_count < $lines_limit)
74            {
75                    $result .= $line;
76            }
77    
78          return $result;          return $result;
79  }  }


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1