Quantcast
Channel: Active questions tagged feedparser - Stack Overflow
Viewing all articles
Browse latest Browse all 106

Parse error while chaining object methods in PHP4

$
0
0

I have a client who needs a website urgently, but I have no access to information such as the control panel.

PHP Version is 4.4 Which is a pain as I'm used to 5.

The first problem is I keep getting:

Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ')' in D:\hshome\*******\********\includes\functions.php on line 37

This is the function in question:

function read_rss($display=0,$url='') {    $doc = new DOMDocument();    $doc->load($url);    $itemArr = array();    foreach ($doc->getElementsByTagName('item') as $node) {        if ($display == 0) {            break;        }        $itemRSS = array('title'=>$node->getElementsByTagName('title')->item(0)->nodeValue,'description'=>$node->getElementsByTagName('description')->item(0)->nodeValue,'link'=>$node->getElementsByTagName('link')->item(0)->nodeValue);         array_push($itemArr, $itemRSS);        $display--;    }    return $itemArr;}

And the line in question:

'title'=>$node->getElementsByTagName('title')->item(0)->nodeValue,

Viewing all articles
Browse latest Browse all 106

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>