Trying to get RSS feeds to display within PHP, but no luck.
Code as follows:
ini_set("include_path", ".:/usr/local/lib/php:/home/alexcg/pear/pear:../:./include:../include");
require_once "XML/RSS.php";
// download and parse RSS data
$rss =& new XML_RSS("http://techrepublic.com.com/5150-22-0.xml");
$rss->parse();
print_r($rss);
// print headlines
print_r($rss->getItems());
-- end code --
Something seems to be happening, since print_r($rss) returns an array with lots of RSS fields but no data, as follows:
XML_RSS Object ( [insideTag] => [activeTag] => [channel] => Array ( ) [items] => Array ( ) [item] => Array ( ) [image] => Array ( ) [textinput] => Array ( ) [textinputs] => Array ( ) [parentTags] => Array ( [0] => CHANNEL [1] => ITEM [2] => IMAGE [3] => TEXTINPUT ) [channelTags] => Array ( [0] => TITLE [1] => LINK [2] => DESCRIPTION [3] => IMAGE [4] => ITEMS [5] => TEXTINPUT ) [itemTags] => Array ( [0] => TITLE [1] => LINK [2] => DESCRIPTION [3] => PUBDATE ) [imageTags] => Array ( [0] => TITLE [1] => URL [2] => LINK ) [textinputTags] => Array ( [0] => TITLE [1] => DESCRIPTION [2] => NAME [3] => LINK ) [moduleTags] => Array ( [0] => DC:TITLE [1] => DC:CREATOR [2] => DC:SUBJECT [3] => DC😃ESCRIPTION [4] => DC😛UBLISHER [5] => DC:CONTRIBUTOR [6] => DC😃ATE [7] => DC:TYPE [8] => DC:FORMAT [9] => DC:IDENTIFIER [10] => DC:SOURCE [11] => DC:LANGUAGE [12] => DC:RELATION [13] => DC:COVERAGE [14] => DC:RIGHTS [15] => BLOGCHANNEL:BLOGROLL [16] => BLOGCHANNEL:MYSUBSCRIPTIONS [17] => BLOGCHANNEL:MYSUBSCRIPTIONS [18] => BLOGCHANNEL:CHANGES ) [folding] => 1 [mode] => event [handler] => Array ( [character_data_handler] => cdataHandler [default_handler] => defaultHandler [processing_instruction_handler] => piHandler [unparsed_entity_decl_handler] => unparsedHandler [notation_decl_handler] => notationHandler [external_entity_ref_handler] => entityrefHandler ) [srcenc] => [tgtenc] => [handlerObj] => XML_RSS Object RECURSION [validEncodings] => Array ( [0] => ISO-8859-1 [1] => UTF-8 [2] => US-ASCII ) [debug] => [default_error_mode] => [default_error_options] => [default_error_handler] => [error_class] => XML_Parser_Error [expected_errors] => Array ( ) ) Array ( )
Anyone know what I'm doing wrong? I've been following tutorials to the letter but no luck at all.
Thanks!