Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting Data from inside a node in XMl with PHP
    text
    copied!<p>So im not sure what or how to really describe what i need but hopefully someone will understand.</p> <p>single element of the total xml file looks like this:</p> <pre> for ( $counter = 1; $counter load($file_xml); //make sure path is correct $note = $objDOM->getElementsByTagName("Event"); // Loop through XML feed $i = 0; foreach( $note as $value ) { $event_id = $value->getAttribute('ID'); # venue id $VenueID = $value->getElementsByTagName("Venue"); $venue_id = $VenueID->item(0)->getAttribute("ID"); } } </pre> <p>arrgggg its not really copying he code exactly. geez.</p> <p>the top is the iteration of the for loop. inside the foreach statement I have the insert statement; which is where I am trying to insert the image URL</p> <pre><code>&lt;Event ID="IDIDIDIDID"&gt; &lt;EventName&gt;EVENT NAME&lt;/EventName&gt; &lt;Artist&gt; &lt;ArtistName&gt;ARTIST NAME&lt;/ArtistName&gt; &lt;/Artist&gt; &lt;Venue ID="IDIDIDID"&gt; &lt;VenueName&gt;VENUE NAME&lt;/VenueName&gt; &lt;Image&gt; &lt;Url&gt;IMAGE_URL&lt;/Url&gt; &lt;Width&gt;205&lt;/Width&gt; &lt;Height&gt;115&lt;/Height&gt; &lt;/Image&gt; &lt;/Venue&gt; &lt;/Event&gt; </code></pre> <p>I am able to get the rest of the imageofmation I need, except for the image URL. i have tried to break it up as an array and get the first value but that didnt work. I saw another post here and tried to use preg_match but that didnt work. does anyone know how i could:</p> <p>get the URL of the image inside the individual "Event" row?</p> <p>this is the beginning of what I have:</p> <pre><code>$Image = $value-&gt;getElementsByTagName("Image"); $venue_img_2 = $Image-&gt;item(1)-&gt;nodeValue; </code></pre> <p>this will return IMAGE_URL 205 115</p> <p>Note: the "space" between the IMAGE_URL and 205 and 115 doesn't seem to actually be a "space"</p> <p>thanks in advance.</p>
 

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