Dosya işleme php nesne yönelimli kavram

2 Cevap

Ben bir txt dosyası içeriği okumak ve aşağı ben bir dosyadan içeriği okuyun Nasıl, PHP nesne yönünü kullanarak bir pdf dosyası içine yüklemek istiyorsanız, bu aynı gibi basit bir PHP IS ...

Acilen beni Lütfen Yardım

Şimdiden teşekkürler ..............

2 Cevap

Nesne-yönelimli gösterimi, ya da nasıl bir nesne olarak içeriğini saklamak için, ya da nasıl bir pdf içine içeriğini taşımak için kullanarak bir dosyanın içeriğini almak için nasıl bilmek ister misiniz?

Son 2 varsayarsak:

//First set the file path and get the contents of the file:
$textfile->path = "path/to/file.txt";
$textfile->contents = file_get_contents($textfile->path);

//Next create the pdf, both as a handler and as a file on disk:
$pdf = PDF_new();
PDF_begin_document($pdf, "file.pdf", "");

//Then put the text file contents into the pdf:
PDF_show($pdf, $textfile->contents);

//Finally, save and close the pdf:
pdf_save($pdf); 
pdf_close($pdf);

Eğer komut bir istek pdf dönmek istiyorum ve sunucuya kaydetmek değil, sadece "file.pdf" "" değiştirmek ve ayarlamak için header() işlevini kullanın dosya.