How to open a PDF files in web browser using PHP?
<?php
// The location of the PDF file
// on the server
$filename = "/doc.pdf";
// Header content type
header("Content-type: application/pdf");
header("Content-Length: " . filesize($filename));
// Send the file to the browser.
readfile($filename);
?>
Example 1:
this examples displays a format and explains every section of code
Output:
Comments
Post a Comment