I'm trying to create a PHP file that will read a pdf and write it out to the browser without giving the user the link to the file. This is an electronic book for download after payment has been received therefore I don't want the link to appear. Here is some code I found in Perl that would do the trip, but I don't want to have to revert to this method. Can someone please give me an equivelant in PHP, I would greatly appreciate it.
print "Content-type: application/pdf\n\n";
$file = "myfile.pdf";
open(SRC, "$file") or die "Can't open file";
binmode(SRC);
while(my $a = <SRC>){
print $a;
}