So im not sure what or how to really describe what i need but hopefully someone will understand.
single element of the total xml file looks like this:
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"); } }
arrgggg its not really copying he code exactly. geez.
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
<Event ID="IDIDIDIDID">
<EventName>EVENT NAME</EventName>
<Artist>
<ArtistName>ARTIST NAME</ArtistName>
</Artist>
<Venue ID="IDIDIDID">
<VenueName>VENUE NAME</VenueName>
<Image>
<Url>IMAGE_URL</Url>
<Width>205</Width>
<Height>115</Height>
</Image>
</Venue>
</Event>
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:
get the URL of the image inside the individual "Event" row?
this is the beginning of what I have:
$Image = $value->getElementsByTagName("Image");
$venue_img_2 = $Image->item(1)->nodeValue;
this will return IMAGE_URL 205 115
Note: the "space" between the IMAGE_URL and 205 and 115 doesn't seem to actually be a "space"
thanks in advance.