Jump to content

Problem with syntax


farban

Recommended Posts

Hey i have a T_OBJECT_OPERATOR syntax error when opening mp3.php page. I know its because its php 4 and dosent understand the code but i want to fix this problem without upgrading to php 5. any help please?

 

mp3.php page

 

<?php
$doc = new DOMDocument();
$doc->load( 'Playlist.xml' );
  
$musiclist = $doc->getElementsByTagName( "mp3" );
foreach( $musiclist as $song )
{
  $artists = $song->getElementsByTagName( "artist" );
  $artist = $artists->item(0)->nodeValue;
  
  $titles= $song->getElementsByTagName( "title" );
  $title= $titles->item(0)->nodeValue;
  
  $urls = $song->getElementsByTagName( "url" );
  $url = $urls->item(0)->nodeValue;
  
  echo "<b>$artist - $title - $url\n</b><br>";
  }
?> 

Link to comment
https://forums.phpfreaks.com/topic/158796-problem-with-syntax/
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.