0

i try to get comment count from a blog post use blog feed. i want to get number inside

<slash:comments>0</slash:comments>

i use this syntax but did not work:

<?php
$feed = file_get_contents("http://www.trenologi.com/feed/");
$xml = new SimpleXmlElement($feed);
foreach($xml->channel->item as $entry) {
$comment = mysql_real_escape_string("$entry->slash:comments");
echo "$comment";
}
?>

i think the error is $entry->slash:comments, what must i write to change slash:comments to get comment count?

thank you daniweb friends.

Edited by silent lover

3
Contributors
3
Replies
14
Views
3 Years
Discussion Span
Last Post by matrixdevuk
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.