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

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


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


Tags:



技术大类 » PHP/JS/Shell | 评论(194) | 引用(0) | 阅读(76712)
Custom Stationery Design Email Homepage
2013-1-21 19:24
Thanks for sharing helpful information, I really like your all post. I will bookmark your blog for future updates.Custom Stationery Design
GAWER
2013-1-29 17:37
买轴承就到:www.jkzhoucheng.cn
Drain Email
2013-1-29 18:56
I am really impressed by this blog! Very clear explanation of issues is given and it is open to everyone. thanks for posting this work of yours..this is very good!
<a href="http://furzoo.com/ensayos-cortos/">Ensayos y Monografias</a>  |  <a href="http://furzoo.com/soc-newsletter/">ensayos cortos</a>
mar1us91 Email Homepage
2013-1-30 22:20
The Coach bags are customarily somewhat many than the ones in the stores. jocuri cu bile
mynet Homepage
2013-2-6 04:32
Türkiye’nin en eski sitelerinden birisi olan mynet, ayrıca türkiye’de en çok tercih edilen sohbet servislerinden olan <a href="http://www.eskimynet.net" title="mynet, mynet sohbet" target="_blank">eski mynet sohbet</a>’in de bulunduğu sitedir. Mynet sohbet, binlerce kişi tarafından her gün ziyaret edilen bir sitedir. <a href="http://www.mynetchatsitesi.com" title="mynet, mynet chat" target="_blank">mynet chat</a> üzerinden istediğiniz odada sohbet etmeye başlayabilirsiniz.
Jack Email
2013-2-14 21:48
I came through google and found this blog very informative i will share this information with my fb friends - thanks for sharing your thoughts regarding this interesting subject.

website design houston
Joanna Email
2013-2-15 16:36
Thanks for sharing helpful information, I really like your all post. I will bookmark your blog for future updates. interior design ideas for living room  home design ideas
Posicionamiento En Google Email Homepage
2013-2-18 20:45
Thanks for your post, I like this post very much
photocopier repairs Essex Email Homepage
2013-2-18 20:47
Hi, interesting post. I have been wondering about this topic, so thanks for posting. I’ll definitely be subscribing to your site. Keep up the good posts
Bread Email
2013-2-26 16:57
Useful information shared...i'm very happy to read this article..thanks for giving us nice info. Fantastic walk-through. I appreciate this post.  interior design ideas for apartments  home design ideas
dinelson Homepage
2013-3-5 15:51
My brother recommended I might like this blog. He was totally right. This post truly made my day. You can’t imagine just how much time I had spent for this information! Thanks how to text a girl you likehow-to-text-a-girl-you-like/
Frederic Email
2013-3-7 18:22
I came through google and found this blog very informative i will share this information with my fb friends - thanks for sharing your thoughts regarding this interesting subject. GeoVision Security Camera
MendesJessica
2013-3-16 13:53
I just read through the entire article of yours and it was quite good. This is a great article thanks for sharing this informative information.

<a href="http://www.where-can-i-buy-ritalin.com">Buy Ritalin Online</a>
Paul Frederic Email
2013-3-21 15:48
great information and i like the way you write - thumbs up!


8 Channel DVR Kit
Paul Frederic Email
2013-3-21 15:48
agreed with your thoughts - given information is really very appreciated thanks for sharing .
jhkljl Email Homepage
2013-3-24 22:48
slmlar  olsunsohbet
jhkljl Email Homepage
2013-3-24 22:51
merhabalar  arkadaslar  türkiyede  bildigimiz  üzere chat siteleri  bir hayli  yogunlukta  bizlerde  bu sese  kulak  verdit  türk  sohbet severleri  bir araya  topladık  sizlerde  sitemizde  yeni  insanlarla  tanışıp  sohbet için  siteye giriş  yapınız..
myname Homepage
2013-3-26 09:36
urlreviews  is where I go
磨延城 Email Homepage
2013-10-21 21:00
磨途歌学习了
分页: 5/10 第一页 上页 1 2 3 4 5 6 7 8 9 10 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]