channel->item as $item) { $episodes[] = [ 'title' => (string) $item->title, 'audioUrl' => (string) $item->enclosure['url'], // Include other details as needed ]; } return $episodes; } // Assuming the RSS feed URL is provided as a query string parameter $feedUrl = $_GET['feedUrl'] ?? 'https://anchor.fm/s/eb11e5cc/podcast/rss'; header('Content-Type: application/json'); echo json_encode(parsePodcastFeed($feedUrl));