Get data with php

nelson c

Well-known member
Hi, can someone help me on how is how to extract data from a structure like:
Code:
<CurrentTrack>
<TRACK ARTIST="Inna Ft. Yandel" TITLE="In Your Eyes"


I tried this code but not working

Code:
$xmls = $can . ':' . $PuertoRB . '/?pass=' . $PassRB . '&action=playbackinfo';

$url = file_get_contents($xmls);
$xml = simplexml_load_string($url);
foreach ($xml->TITLE as $cancion)
 
I think you incorrectly use the $xml variable.
You should use $xml->TRACK, like this:
Code:
$title = $xml->TRACK[0]['TITLE'];
 
I have other more and more technical consultation.
I'm doing a web remote control to radiboss.

For now the list changes are to be made to update the page.
for that reason, to show the track of the "before" panel, I need to save to the server somehow.
It is the best way using two temporary files?
 

Attachments

  • remote.png
    remote.png
    102.5 KB · Views: 469
nelson c said:
Thanks Dmitry for your response.  :)
Your code seems to be logical, but it shows nothing.

Already achieved! :). code that works is as follows:
Code:
$title = $xml->CurrentTrack[0]->TRACK[0]['TITLE'];
 
nelson c said:
For now the list changes are to be made to update the page.
for that reason, to show the track of the "before" panel, I need to save to the server somehow.
It is the best way using two temporary files?
Yes, using temporary files is OK. Another way is to store it in the database.
 
Back
Top