php - Parsing/Open XML document in echo -
i have radio automation software (radioboss) , wish artist information (milky chance) , song title (stolen dance) through xml document (http://inlivefm.6te.net/nowplaying2.xml) of php echo, not able obtain information.
i present project / php code see if can detect fault.
<?php $x = simplexml_load_file('http://inlivefm.6te.net/nowplaying2.xml'); echo '<font color="#d81c1c" face="oswald" size="4px" style="display:inline">'; echo $x->player[0]->title[0]; echo ' - '; echo '</font>'; ?>
i tried analyze through link: how display info if tag value x
i tried test explanation in link without success, came ask help.
the information presented in attributes in xml provided. have read attributes of element.
you can achieve goal using php code below.
$xml = simplexml_load_file('http://inlivefm.6te.net/nowplaying2.xml'); echo '<font color="#d81c1c" face="oswald" size="4px" style="display:inline">'; echo $xml->track["artist"]; echo ' - '; echo $xml->track["title"]; echo '</font>';
it helpful check simplexml documentation while dealing issues that. http://php.net/manual/en/book.simplexml.php
Comments
Post a Comment