我想使用 fpdf 生成 PDF 文件
但我收到如下错误: fpdf错误:某些数据已输出,无法发送pdf文件
<?php
$indexcontent = mysql_real_escape_string($_GET['index']);
$detailview = mysql_query("SELECT * FROM `searchengine` WHERE `indexcontent` = '$indexcontent'") or die(mysql_error());
if($result = mysql_fetch_assoc($detailview))
{
$filepdf = $result['maincontent'];
require('fpdf.php');
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'$filepdf');
$pdf->Output();
}
?>
最佳答案
不要将变量放在单引号之间,尝试放在双引号之间。
关于php - 无法使用 php、mysql 获取 pdf 文件作为输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34450518/