Beste,
Ik gebruik de volgende code om een XML uit te lezen en te weergeven op me site:
Zoals je ziet gaat dat goed, met de link die hij pakt.PHP Code:
<?php
$XML = simplexml_load_file( 'http://feeds.musicchartfeeds.com/itunes-hiphop-rap-chart?format=xml' );
$Count = 0;
foreach( $XML -> channel -> item as $Key => $Value )
{
echo '<strong>' . $Value -> title . '</strong><br /><small>' . $Value -> description . '</small><br /><br />';
$Count++;
if ( $Count == 100 )
{
break;
}}
?>
Enkel wil ik graag ook de afbeelding uitlezen en weergeven maar dat lukt niet.
Ziet iemand misschien wat ik fout doe ?
http://feeds.musicchartfeeds.com/itu...art?format=xml
- XML uitlezen probleem
-
06-02-2010, 15:23 #1
- Berichten
- 697
- Lid sinds
- 17 Jaar
XML uitlezen probleem
-
-
06-02-2010, 15:26 #2
- Berichten
- 257
- Lid sinds
- 15 Jaar
Niet om het één of ander maar ik zie geen afbeeldingen op de pagina waarnaar je linkt. Doe ik iets verkeerd?
-
06-02-2010, 15:31 #3
- Berichten
- 697
- Lid sinds
- 17 Jaar
Die is er toch echt !!
-
06-02-2010, 15:44 #4
- Berichten
- 697
- Lid sinds
- 17 Jaar
Oplossing !!
PHP Code:<?php
$contents = file_get_contents('http://feeds.musicchartfeeds.com/itunes-hiphop-rap-chart?format=xml');
$contents = str_replace("itms:", "itms", $contents);
$xml = simplexml_load_string($contents);
$count = 0;
foreach($xml->channel->item as $key => $value) {
echo '<table border="0" width="100%">
<tr>
<td width="75">
<img src="'.$value->itmscoverArt.'">
</td>
<td>
<table border="0" width="100%">
<tr>
<td><strong>' . $value -> title . '</strong></td>
</tr>
<tr>
<td><small>' . $value -> description . '</small></td>
</tr>
</table>
</td>
</tr>
</table><br />';
$Count++;
if ( $Count == 100 )
{
break;
}}
?>
-
08-02-2010, 07:56 #5
- Berichten
- 257
- Lid sinds
- 15 Jaar
Plaats een
- + Advertentie
- + Onderwerp
Marktplaats
Webmasterforum
- Websites algemeen
- Sitechecks
- Marketing
- Domeinen algemeen
- Waardebepaling
- CMS
- Wordpress
- Joomla
- Magento
- Google algemeen
- SEO
- Analytics
- Adsense
- Adwords
- HTML / XHTML
- CSS
- Programmeren
- PHP
- Javascript
- JQuery
- MySQL
- Ondernemen algemeen
- Belastingen
- Juridisch
- Grafisch ontwerp
- Hosting Algemeen
- Hardware Info
- Offtopic