<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>naosim</author_name>
  <author_url>https://blog.hatena.ne.jp/naosim/</author_url>
  <blog_title>なおしむ論</blog_title>
  <blog_url>https://naosim.hatenablog.jp/</blog_url>
  <categories>
    <anon>php</anon>
  </categories>
  <description>今日はPHPの話。 文字列のjsonをデコードしてエンコードする簡単なお仕事。 &lt;?php $raw = '{&quot;hoge&quot;:{}}';// 空オブジェクト $map = json_decode($raw, true); $result = json_encode($map); echo($result);// 元どおり {&quot;hoge&quot;:{}} になることを期待する 最後のechoは$rawと同じで '{&quot;hoge&quot;:{}}' になると思うじゃん。 でも実際はこれ。 {&quot;hoge&quot;:[]} 空オブジェクトが空配列になってるーーー！！！ だってPHPは連想配列もarrayだもん 考えてみれば当たり…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnaosim.hatenablog.jp%2Fentry%2F2018%2F01%2F11%2F070000&quot; title=&quot;PHPはJSONの空オブジェクトに弱い - なおしむ論&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>2018-01-11 07:00:00</published>
  <title>PHPはJSONの空オブジェクトに弱い</title>
  <type>rich</type>
  <url>https://naosim.hatenablog.jp/entry/2018/01/11/070000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
