Oct 21
2005

Here is the UTF-8 version:

Note:

If the string is UTF-8 encoded, 1 Chinese Character is with length 3 if using PHP strlen().
If the string is GB encoded, 1 Chinese Character is with length 2 if using PHP strlen().

For example:

$str = “Hello你好么”;
print utf8_strlen2($str); // print 8
utf8_substr2($str, 0, 6); // print “Hello你”


/***********Start of Code ***************/

function utf8_substr2($str,$start) {

Continue reading »

Oct 21
2005

前些日子在天涯上看到的。挑了一些经典的贴上。有的简直太像了,都不知道是不是明星他本人。

菲佣版吴宗宪

Continue reading »