最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Change fullwidth characters to halfwidth - Stack Overflow

programmeradmin5浏览0评论
"合同会社Knowledge Library" => "合同会社Knowledge Library"

I want to convert only alphanumeric characters in the string to single byte using java script or php

"合同会社Knowledge Library" => "合同会社Knowledge Library"

I want to convert only alphanumeric characters in the string to single byte using java script or php

Share Improve this question edited Apr 25, 2012 at 6:48 Ibrahim Azhar Armar 25.8k36 gold badges135 silver badges212 bronze badges asked Apr 25, 2012 at 5:45 Pradeep SathyarajPradeep Sathyaraj 1342 silver badges10 bronze badges 4
  • Both strings look the same to me. Is that a typo? – Ja͢ck Commented Apr 25, 2012 at 5:59
  • Looks same but the bytes are different, Use shift js encoding you can find the difference in bytes – Pradeep Sathyaraj Commented Apr 25, 2012 at 6:04
  • @Jack Then your system does not render it properly. The full width forms should be as wide as the Chinese characters, not proportionally spaced as usual. – deceze Commented Apr 25, 2012 at 6:54
  • @deceze I saw the difference in rendering, but I assumed it was SO formatting problem ;-) – Ja͢ck Commented Apr 25, 2012 at 6:56
Add a ment  | 

1 Answer 1

Reset to default 6

In PHP, use mb_convert_kana to convert "zen-kaku" to "han-kaku".

发布评论

评论列表(0)

  1. 暂无评论