<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yutakikuchi</author_name>
  <author_url>https://blog.hatena.ne.jp/yutakikuchi/</author_url>
  <blog_title>Y's note</blog_title>
  <blog_url>https://yut.hatenablog.com/</blog_url>
  <categories>
    <anon>PHP</anon>
  </categories>
  <description>内容 久しぶりにxmlをパースする処理を書いていたんだけど、SimpleXMLElement Objectの参照方法を忘れていたのでメモをしておく。(20120416追記) 今まではサンプルプログラム中のforeachで$resultに添字$iでインクリメントして値を代入していましたが、$iを使わずに配列の[]を使って右辺のarray型を代入するように修正しました。 xmlサンプル &lt;?xml version=&quot;1.0&quot; encoding=&quot;Shift-Jis&quot; ?&gt; &lt;venture&gt; &lt;company&gt; &lt;name&gt;ソフトバンク株式会社&lt;/name&gt; &lt;url&gt;http://www.sof…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyut.hatenablog.com%2Fentry%2F20101215%2F1292427841&quot; title=&quot;SimpleXMLElement Objectの参照 - Y&amp;#39;s note&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>2010-12-15 00:44:01</published>
  <title>SimpleXMLElement Objectの参照</title>
  <type>rich</type>
  <url>https://yut.hatenablog.com/entry/20101215/1292427841</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
