List out different arguments in PHP header function?
Answer Posted / sivasankar.p
header —
Send a raw HTTP header
syntax-
void header ( string $string [, bool $replace [,
int $http_response_code ]] )
ex:
<?php
// We'll be outputting a PDF
header('Content-type: application/pdf');
// It will be called downloaded.pdf
header('Content-Disposition: attachment;
filename="downloaded.pdf"');
// The PDF source is in original.pdf
readfile('original.pdf');
?>
| Is This Answer Correct ? | 9 Yes | 3 No |
Post New Answer View All Answers
How to track user logged out or not? When user is idle?
How to redirect https to http url through .htaccess?
How should a model be structured in mvc?
What is phpsessid?
Write a program in php to check whether a number is prime or not?
Where is session id stored?
Can a super () and this () keywords be in same constructor?
How to get ip address of a server in php?
sort term descripttion form, report and uery
How to get the total number of values in an array?
Explain how does one prevent the following warning ‘warning: cannot modify header information – headers already sent' and why does it occur in the first place?
Is php easier than javascript?
How to include a file to a PHP page?
Explain how to execute a php script using command line.
What is escape data in php?