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

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


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


Tags:



技术大类 » PHP/JS/Shell | 评论(194) | 引用(0) | 阅读(77700)
john Email
2012-9-7 00:00
The idea behind this article is excellent, and for me the first item ("Create your own damn content!") is the real gem here: most of the people spend their entire lives only consuming what is created by others, and creating nothing themselves--or never sharing what they create, which is better than not creating at all, though not the best they could do. pakistani restaurant in Melbourne
the best seo Company Email Homepage
2012-9-7 01:39
I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you! The information that you have provided is very helpful.
the best seo Company Email Homepage
2012-9-7 02:41
Great blog. All posts have something to learn. Your work is very good and i appreciate you and hopping for some more informative posts.
organic seo company Email Homepage
2012-9-7 05:02
Thanks for your many years of a great service well done! I’ve always felt good about listing my concerts with you and linking from my website.
cost effective seo Email Homepage
2012-9-7 06:08
I am happy when reading your blog with updated information! thanks a lot and hope that you will post more site that are related to this site.
cost effective seo
locksmith in bethesda md Email Homepage
2012-9-12 07:51
Thanks for your marvelous posting! I actually enjoyed reading it, you will be a great author.I will ensure that I bookmark your blog and will come back in the foreseeable future. I want to encourage that you continue your great job, have a nice weekend!think you’ve made some truly interesting points
Washington dc locksmith Email Homepage
2012-9-12 17:37
I have no words to appreciate this post ..... I'm really impressed with this post .... the person who created this post was a big thank you man .. for sharing with us.
emeca
2012-9-12 23:33
Hi! This is my first visit to your blog! We are a team of volunteers and new initiatives in the same niche. Blog gave us useful information to work. You have done an amazing job!
locksmith in silver spring md  
sleepyanger
Towing in dallas Email Homepage
2012-9-13 17:47
With the many blogs which I have encountered, I never expected to see a very beautiful post online..After reading this one, I felt so lucky to see its content..-)
Ethan
2012-9-15 15:31
Hi there,You have done really nice job. There are many people searching about that now they will find enough sources by your tips.looking forward for more tips about thatfrisco towing
Nicl
2012-9-20 16:58
Wonderful post. I am searching awesome news and idea. What I have found from your site, it is actually highly content. You have spent long time for this post. It's a very useful and interesting site. Thanks! moving companies washington dc
mulberry outlet
2012-10-3 16:46
mulberry outlet.You can possibly shop on the net, or go to a nearest outlet to get the bag.mulberry outlet. If you would acquire from the on the internet webpage of the brand, then you would be acquiring the unique item for convinced but buying for a save isn't going to generally ensure the originality of the bag that you are arranging to invest in.mulberry outlet. Hence, on-line procuring is a much better and much more feasible alternative as opposed to the other a person.mulberry sale.
SteveBrad Email
2012-10-10 17:15
Well, this is so nice to think about leaving comment here. Nice to meet you all. | Buy Generic Viagra |
john Homepage
2012-10-12 03:00
A healthy diet is not about strict nutrition philosophies, staying extremely thin, or depriving yourself of foods you love. Rather it is to get that good to have more energy and you keep healthy as possible.
home mortgage loan company
Chika Email Homepage
2012-10-12 04:39
You’ve written nice post, I am gonna bookmark this page, thanks for info. I actually appreciate your own position and I will be sure to come back here.
24 Hour taxi service
john Homepage
2012-10-12 05:55
Wonderful post. I am searching awesome news and idea. What I have found from your site, it is actually highly content. You have spent long time for this post. It's a very useful and interesting site. Thanks!
intercom nyc
larry
2012-10-23 09:10
Thanks for sharing. play y8 new games
nazzo
2012-10-24 22:30
this is very great stuff. dating
card access control systems Email Homepage
2012-10-26 02:22
A healthy diet is not about strict nutrition philosophies, staying extremely thin, or depriving yourself of foods you love. Rather it is to get that good to have more energy and you keep healthy as possible. card access control systems
cctv security system
2012-10-26 04:23
I am speechless after seeing these pictures! I love them all! I teach kindergarten and I'm going to make a theme, and photographs have given me so many ideas! You are so talented! Thanks! cctv security system
分页: 2/10 第一页 上页 1 2 3 4 5 6 7 8 9 10 下页 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]