- fclose: documentation ( source)
- fwrite: documentation ( source)
- fopen: documentation ( source)
<?php
$myfile = fopen("newfile.php", "w") or die("Unable to open file!");
$txt = "<?php
require('fpdf.php');
\$pdf = new FPDF();
\$pdf->AddPage();
\$pdf->SetFont('Arial','B',16);
\$pdf->Cell(40,10,'{$_POST['customerName']}');
\$pdf->Output();
?>";
echo $txt;
fwrite($myfile, $txt);
$txt = "Minnie Mouse\n";
fwrite($myfile, $txt);
fclose($myfile);
?>