Posted By

daisuke103 on 02/24/08


Tagged

php width textmate str mb len strimwidth


Versions (?)

PHP 全角を2文字として切り出す 文字列の見た目を揃える


 / Published in: Other
 

  1. <?php $len = 10;
  2. print(mb_strimwidth("abcdefghijklmnopqrstu", 0, $len, "", "UTF-8") . "<br />");
  3. print(mb_strimwidth("あいうえおかきくけこさしすせそ", 0, $len, "", "UTF-8") . "<br />");
  4. print(mb_strimwidth("あいうabcえおかdefきくけghi", 0, $len, "", "UTF-8") . "<br />"); ?>

Report this snippet  

You need to login to post a comment.