Possible Duplicate:
Forcing to download a file using PHP
If I have a json in a variable, how can I force the download? (The file not exist).
Thanks.
Possible Duplicate:
Forcing to download a file using PHP
If I have a json in a variable, how can I force the download? (The file not exist).
Thanks.
header('Content-disposition: attachment; filename=file.json');
header('Content-type: application/json');
echo $json;
$json = json_encode( array( 'test' => 'test' ));
header('Content-disposition: attachment; filename=jsonFile.json');
header('Content-type: application/json');
echo( $json);