[文章作者:张宴 本文版本:v1.0 最后修改:2007.08.15 转载请注明出处:http://blog.zyan.cc]

  当PHP截取中英文混合字符串时,最后一个汉字经常被拆成两半,例:截取字符串的前18个字
  输出为结果为:
引用
1欢迎访问新浪?BR>


  于是写了以下这段代码,判断如果中英文混合字符串中的汉字字节数为奇数,则少截取一个字节,保证汉字显示完整。
  输出为结果为:
引用
1欢迎访问sina新浪


Tags:



技术大类 » PHP/JS/Shell | 评论(194) | 引用(0) | 阅读(77702)
shzz Email
2022-7-4 19:18
Hi, I log on to your new stuff like every week. Your humoristic style is witty, keep it up  Digital real estate business
shzz Email
2022-7-4 19:21
I really thank you for the valuable info on this great subject and look forward to more great posts  Digital real estate business
shz Email
2022-7-4 19:23
I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day!  Digital real estate business
goha
2023-11-13 23:05
iTubeGo Crack is software systems for downloading video clips and audio from numerous trendy streaming web pages nowadays. Movie is one of quite possibly the most sought-after media in these days, but most streaming websites never offer a
Lucky cola
2024-2-7 16:43
Gaming nirvana starts here.  Lucky cola
afetsu Email
2024-5-15 22:00
Çok güzel bir site https://www.dinisohbeti.com
afetsu Email
2024-5-15 22:01
Thank you very much dear admin this is site very beaitiful https://www.canlarsohbet.net
分页: 10/10 第一页 上页 5 6 7 8 9 10 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]