note 33409 modified in function.chr by vrana
| From: | vrana@php.net | Date: | Tue, 17 Aug 2004 14:54:43 +0000 |
| Subject: | note 33409 modified in function.chr by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79719@lists.php.net to get a copy of this message | ||
Cutting Korean(2Byte)-String
<?php
function cutStr($str,$len){
if(strlen($str) > $len){
$str = substr($str,0,$len - 2);
if(strlen(substr(strrchr($str," "),1)) % 2)
$str = substr($str,0,strlen($str) - 1);
$str .= "..";
}
return $str;
}
?>
--was--
Cutting Korean(2Byte)-String
function cutStr($str,$len){
if(strlen($str) > $len){
$str = substr($str,0,$len - 2);
if(strlen(substr(strrchr($str," "),1)) % 2)
$str = substr($str,0,strlen($str) - 1);
$str .= "..";
}
return $str;
}
http://php.net/manual/en/function.chr.php