Parsing WordPress XML, slash:comments syntax?

Posted by user313653 on Stack Overflow See other posts from Stack Overflow or by user313653
Published on 2010-04-10T21:33:47Z Indexed on 2010/04/10 22:43 UTC
Read the original article Hit count: 309

Filed under:
|
|
|
|

This is really just a syntax question.

I have a PHP script that parses my WordPress feed and returns the latest posts. I also want my script to parse the # of comments, but the WordPress feed XML object for number of comments has a colon in it (slash:comments). It causes the following error:

Parse error: syntax error, unexpected ':' in ... on line ...

I have tried each of the following without luck:

$xml->slash:comments

$comments = 'slash:comments'
$xml->$comments

$xml->slash.':'.comments
$xml->{slash:comments}
$xml->{'slash:comments'}

How do I parse an object with a colon?

© Stack Overflow or respective owner

Related posts about parse

Related posts about Xml