Tip: Click lines to highlight, hold ctrl/cmd to multi-select

http://codedumper.com/uruqo (14-Aug @ 17:36)

Syntax Highlighted Code

  1. <?php
  2. foreach ($songs as $mp3file)
  3. {    
  4.     //Get the filename of the song
  5.     $temp_filename = explode('/',$mp3file);
  6.     $filename = $temp_filename[count($temp_filename)-1];
  7.     $filename = urldecode($filename);
  8.    
  9.     echo "Start downloaden ".$filename."<br>";
  10.    
  11.     //Get the song
  12.     if(!$filecontent = @file_get_contents($mp3file))
  13.     {
  14.         echo "Downloaden niet voltooid! ".$filename;
  15.     }
  16.    
  17.     //Save the song
  18.     file_put_contents($filename,$filecontent);
  19.     echo "Downloaden voltooid: ".$filename."<br>";
  20.     echo "---------------------------------------";
  21. }
  22. ?>

Plain Code

<?php
foreach ($songs as $mp3file)
{    
    //Get the filename of the song
    $temp_filename = explode('/',$mp3file);
    $filename = $temp_filename[count($temp_filename)-1];
    $filename = urldecode($filename);
    
    echo "Start downloaden ".$filename."<br>";
    
    //Get the song
    if(!$filecontent = @file_get_contents($mp3file))
    {
        echo "Downloaden niet voltooid! ".$filename;
    }
    
    //Save the song
    file_put_contents($filename,$filecontent);
    echo "Downloaden voltooid: ".$filename."<br>";
    echo "---------------------------------------";
}
?>

Permalink: http://codedumper.com/uruqo