Fatal error: Call to undefined method SimpleXMLElement::attribute() in D:\Program Files\wamp\www\New folder\ndtv_news.php on line 13
How to define method .....
<?php
//fetches articles from NDTV news RSS feed
function fetch_news(){
$data = file_get_contents('http://feeds.feedburner.com/News-TN');
$data = simplexml_load_string($data);
$articles = array();
foreach ($data->channel->item as $item){
$media = $item->children('http://search.yahoo.com/mrss');
$image = array();
foreach($media->attribute() as $key => $value)
{
$image[$key] = (string)$value;
}
$articles[] = array('title'=>(string)$item->title,
'description'=>(string)$item->description,
'link'=>(string)$item->link,
'date'=>(string)$item->pubDate,
'image'=>'$image');
}
return $articles;
}
?>
Register and join over 40,000 other developers!
Recent Topics
-
The Game You Are Waiting For?
WendellHarper - Dec 06 2020 01:21 PM
-
Quora and Reddit Backlinks
WendellHarper - Dec 06 2020 01:14 PM
-
Delete account
pindo - Jul 23 2020 01:33 AM
-
Print specific values from dictionary with a specific key name
Siten0308 - Jun 20 2019 01:43 PM
-
Learn algorithms and programming concepts
johnnylo - Apr 23 2019 07:49 AM
Recent Blog Entries
Recent Status Updates
Popular Tags
- networking
- Managed C++
- stream
- console
- database
- authentication
- Visual Basic 4 / 5 / 6
- session
- Connection
- asp.net
- import
- syntax
- hardware
- html5
- array
- mysql
- java
- php
- c++
- string
- C#
- html
- loop
- timer
- jquery
- ajax
- javascript
- programming
- android
- css
- assembly
- c
- form
- vb.net
- xml
- linked list
- login
- encryption
- pseudocode
- calculator
- sql
- python
- setup
- help
- game
- combobox
- binary
- hello world
- grid
- innerHTML

Fatal error: Call to undefined method SimpleXMLElement::attribute()
Started by
anjshr7
, Jul 20 2015 10:34 PM
xml php
No replies to this topic
#1
Posted 20 July 2015 - 10:34 PM
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download