format_rss_channel

Versions
4.6 – 5
format_rss_channel($title, $link, $description, $items, $language = 'en', $args = array())
6 – 7
format_rss_channel($title, $link, $description, $items, $langcode = NULL, $args = array())

Formats an RSS channel.

Arbitrary elements may be added using the $args associative array.

Related topics

▾ 1 function calls format_rss_channel()

node_feed in modules/node.module
A generic function for generating RSS feeds from a set of nodes.

Code

includes/common.inc, line 644

<?php
function format_rss_channel($title, $link, $description, $items, $language = 'en', $args = array()) {
  // arbitrary elements may be added using the $args associative array

  $output = "<channel>\n";
  $output .= ' <title>'. check_plain($title) ."</title>\n";
  $output .= ' <link>'. check_url($link) ."</link>\n";
  $output .= ' <description>'. check_plain($description) ."</description>\n";
  $output .= ' <language>'. check_plain($language) ."</language>\n";
  foreach ($args as $key => $value) {
    $output .= ' <'. $key .'>'. check_plain($value) ."</$key>\n";
  }
  $output .= $items;
  $output .= "</channel>\n";

  return $output;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.