<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>AJYA</author_name>
  <author_url>https://blog.hatena.ne.jp/AJYA/</author_url>
  <blog_title>ソフトウェア開発者の日常</blog_title>
  <blog_url>https://ajya.hatenablog.jp/</blog_url>
  <categories>
    <anon>PHP</anon>
  </categories>
  <description>帳票出力のために、出力する文字列の長さが全角で20文字を超えたら、強制的に改行をしなければならなくなりました。 文字コードがUTF-8なので、strlen()とmb_strlen()では、全角20文字が正しく数えられません。 PHP: strlen - Manual PHP: mb_strlen - Manual unsplash-logoMaybritt Devriese Shift_JISに変換する？ Shift_JISであれば全角2バイト、半角1バイトでわかるので、全角換算の文字数は、バイト数/2でわかります。 こんな感じでしょうか。 $str = mb_convert_encoding…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fajya.hatenablog.jp%2Fentry%2F2018%2F06%2F26%2F173000&quot; title=&quot;PHP：文字数を数える方法 - ソフトウェア開発者の日常&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/A/AJYA/20180626/20180626172249.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-06-26 17:30:00</published>
  <title>PHP：文字数を数える方法</title>
  <type>rich</type>
  <url>https://ajya.hatenablog.jp/entry/2018/06/26/173000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
