Editing a remote RSS and saving it Locally

Discussion in 'PHP' started by -dj-, Jun 22, 2009.

  1. #1
    I want to read a remote RSS feed (have the feed URL) and make few changes to the content, and save it locally as XML file.

    Any help would be greatly appreciated.
     
    -dj-, Jun 22, 2009 IP
  2. tarponkeith

    tarponkeith Well-Known Member

    Messages:
    4,758
    Likes Received:
    279
    Best Answers:
    0
    Trophy Points:
    180
    #2
    
    
    <?php
    $file_data = file_get_contents('http://www.domain.com/feed.xml');
    
    // do modifications here
    
    $fcon = fopen('textfile.txt', 'w') or die("rut roh!");
    fwrite($fcon, $file_data);
    fclose($fcon);
    
    ?>
    
    
    PHP:
     
    tarponkeith, Jun 23, 2009 IP