Download a .mp3 link and save it to computer with PHP
问题 I've got lots of direct .mp3 links in a .txt file that I'd like to save on my computer (like this: http://mylink.mp3 ), and I was wondering how I could do this with PHP ? Should I use file_get_contents ? (Sorry if my questions was already answered here, I searched but it didn't help me) Thank you :). 回答1: $file = 'http://somewebsite.com/thesong.mp3'; header("Content-type: application/x-file-to-save"); header("Content-Disposition: attachment; filename=".basename($file)); readfile($file); You