Note that there are some explanatory texts on larger screens.

plurals
  1. POTraversing XML in PHP
    primarykey
    data
    text
    <p>I have the following XML code that I'm trying to parse, but I'm sure of how to traverse some of the data in PHP:</p> <pre><code> &lt;entry&gt; &lt;id&gt;http://data.treasury.gov:8001/Feed.svc/DailyTreasuryYieldCurveRateData(5360)&lt;/id&gt; &lt;title type="text"&gt;&lt;/title&gt; &lt;updated&gt;2011-06-09T20:15:18Z&lt;/updated&gt; &lt;author&gt; &lt;name /&gt; &lt;/author&gt; &lt;link rel="edit" title="DailyTreasuryYieldCurveRateDatum" href="DailyTreasuryYieldCurveRateData(5360)" /&gt; &lt;category term="TreasuryDataWarehouseModel.DailyTreasuryYieldCurveRateDatum" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /&gt; &lt;content type="application/xml"&gt; &lt;m:properties&gt; &lt;d:Id m:type="Edm.Int32"&gt;5360&lt;/d:Id&gt; &lt;d:NEW_DATE m:type="Edm.DateTime"&gt;2011-06-01T00:00:00&lt;/d:NEW_DATE&gt; &lt;d:BC_1MONTH m:type="Edm.Double"&gt;0.04&lt;/d:BC_1MONTH&gt; &lt;d:BC_3MONTH m:type="Edm.Double"&gt;0.05&lt;/d:BC_3MONTH&gt; &lt;d:BC_6MONTH m:type="Edm.Double"&gt;0.11&lt;/d:BC_6MONTH&gt; &lt;d:BC_1YEAR m:type="Edm.Double"&gt;0.18&lt;/d:BC_1YEAR&gt; &lt;d:BC_2YEAR m:type="Edm.Double"&gt;0.44&lt;/d:BC_2YEAR&gt; &lt;d:BC_3YEAR m:type="Edm.Double"&gt;0.74&lt;/d:BC_3YEAR&gt; &lt;d:BC_5YEAR m:type="Edm.Double"&gt;1.6&lt;/d:BC_5YEAR&gt; &lt;d:BC_7YEAR m:type="Edm.Double"&gt;2.28&lt;/d:BC_7YEAR&gt; &lt;d:BC_10YEAR m:type="Edm.Double"&gt;2.96&lt;/d:BC_10YEAR&gt; &lt;d:BC_20YEAR m:type="Edm.Double"&gt;3.83&lt;/d:BC_20YEAR&gt; &lt;d:BC_30YEAR m:type="Edm.Double"&gt;4.15&lt;/d:BC_30YEAR&gt; &lt;d:BC_30YEARDISPLAY m:type="Edm.Double"&gt;4.15&lt;/d:BC_30YEARDISPLAY&gt; &lt;/m:properties&gt; &lt;/content&gt; &lt;/entry&gt; </code></pre> <p>I can only get so far as</p> <pre><code>entry-&gt;content </code></pre> <p>As the following throws an error for having a colon:</p> <pre><code>entry-&gt;content-&gt;m:properties </code></pre> <p>How do I access what's inside content such as d:NEW_DATE?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload