<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>TakiTake</author_name>
  <author_url>https://blog.hatena.ne.jp/TakiTake/</author_url>
  <blog_title>TakiTakeの日記</blog_title>
  <blog_url>https://takitake.hatenablog.com/</blog_url>
  <categories>
    <anon>php</anon>
  </categories>
  <description>htmlspecialchars_decodeの場合 探せば関数があるでお馴染みのPHP &lt;p&gt;hoge&amp;nbsp;huga&amp;lt;&amp;gt;&lt;/p&gt; こんな、HTMLのタグ内の文字数を数えたくて実態参照を戻す関数ないかな？と思ったらあった。 htmlspecialchars_decode &lt;?php // $htmlに変換したいhtmlが格納されているとする $html = strip_tags(htmlspecialchars_decode($html)); var_dump($html); 理想 string 'hoge huga&lt;&gt;' (length=11) 現実 string 'hog…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakitake.hatenablog.com%2Fentry%2F20090220%2Fp2&quot; title=&quot;htmlspecialchars_decodeはやめて、html_entity_decodeで実態参照をデコード - TakiTakeの日記&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></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2009-02-20 00:00:01</published>
  <title>htmlspecialchars_decodeはやめて、html_entity_decodeで実態参照をデコード</title>
  <type>rich</type>
  <url>https://takitake.hatenablog.com/entry/20090220/p2</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
