Jump to content

only displaying first record


flemingmike

Recommended Posts

im starting to hate php!?!  i can only get this to display the first record from the xml.  any ideas?

 

<?php

$xml = "http://www.durhamit.ca:8181/1.0/?method=database.search&searcharg=a";

$xml_content = file_get_contents($xml);

transform_xml_to_html($xml);


function transform_xml_to_html($xml) {

$data = simplexml_load_file($xml);

foreach($data as $tracks) {


		echo '<div class="weatherIcon">';
			echo 'Artist: '.$tracks->track->artist.'';
		echo '</div>';

}

}



?>

Link to comment
https://forums.phpfreaks.com/topic/204760-only-displaying-first-record/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.