PHP: Capture RSS feed

/ Published in: PHP
Save to your folder(s)

AJAX by default only lets you play within your own but there are plenty of times where you want to use someone else's feed. Check out to understand the rest.

Copy this code and paste it in your HTML
  1. <?php
  2. if (!isset($_REQUEST["url"])) exit;
  4. $url = $_REQUEST["url"];
  5. if (substr($url, -0, 7) != "http://") exit;
  7. echo file_get_contents($url);
  8. ?>

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.