function enclosures($type = '/.*/')
{
$enclosures = array();
if (isset($this->item['enclosure#'])) {
// Loop through enclosure, enclosure#2, enclosure#3, ....
for ($i = 1; $i <= $this->item['enclosure#']; $i++) {
$eid = $i > 1 ? "#{$id}" : "";
// Does it match the type we want?
if (preg_match($type, $this->item["enclosure{$eid}@type"])) {
$enclosures[] = array("url" => $this->item["enclosure{$eid}@url"], "type" => $this->item["enclosure{$eid}@type"], "length" => $this->item["enclosure{$eid}@length"]);
}
}
}
return $enclosures;
}