html - Parse XML link with PHP -


i have xml feed looks this:

xml

i can parse title enough using simplexml:

$pictureboxxmlfeed = simplexml_load_file('https://www.picturebox.tv/xml/feeds/findanyfilm/findanyfilm.xml');;  echo $pictureboxxmlfeed->entry[1]->title;  foreach($pictureboxxmlfeed->entry $value){      echo $value->title;     echo '<br/>';  } 

but need grab link element in feed looks this:

<link href="http://www.picturebox.tv/watchnow?id=ukic30" rel="alternate"/> 

fyi, doesn't work:

echo $value->link;

thanks help...

is mean?

$string = ' <entry>     <link href="http://www.picturebox.tv/watchnow?id=ukic30" rel="alternate"/> </entry>';  $simplexml = simplexml_load_string($string); foreach($simplexml->link->attributes() $name => $value) {     echo $name.': '.$value.'<br />'; } 

gives:

href: http://www.picturebox.tv/watchnow?id=ukic30 rel: alternate 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -