1

Hi i have an unstyled xml page that i need to get content from the un styled page has the content bellow

    <videourls vid1="rtsp://site.stream" vid2="rtsp://site.stream" />

this is the only content in the page

how can i get the url in vid2?

i have tried to use curl to get the page and html dom but all are showing me blank wen i try and echo out i have all so tried simplexml but just cant get it or get it to work

could anyone help with this a friend of mines said to try to set the header to xml and use a cahed copy to get but i tried gooling for this kind of thing and couldnt find it and got a bit confused

Jens A. Koch
  • 39,862
  • 13
  • 113
  • 141

1 Answers1

0
<?php

$content = '<videourls vid1="rtsp://site.stream1" vid2="rtsp://site.stream2" />';

$doc = new DOMDocument();
$doc->loadHTML($content);

$tags = $doc->getElementsByTagName('videourls');

foreach ($tags as $tag) {
    echo $tag->getAttribute('vid2');
}
Jens A. Koch
  • 39,862
  • 13
  • 113
  • 141