open pdf file in browser php
snippet in php

open pdf file in browser php

user7617

<?php
    // Store the file name into variable
    $file = 'filename';
    $filepath = "https://www.example.com/".$file;
    // Header content type
    header("Content-type: application/pdf");
    // Send the file to the browser.
    readfile($filepath);