Download a Variable with PHP

Written by  on April 12, 2016 

You have a variable in php which should get into a file for download. But you don’t want to put it actually into a file? Then call the following script which does exactly that for you:

header("Content-type: text/plain");
header("Content-Disposition: attachment; filename=$filename");

Category : Allgemein

Tags :

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

This site uses Akismet to reduce spam. Learn how your comment data is processed.