如何更改我的 mPDF Output() 的根文件夹?

How can I change the root folder of my mPDF Output()?

如何更改我的 mPDF 的根文件夹 Output()

我需要一个从变量中获取的文件名,该文件应保存在我名为“/files”的文件夹中。文件的位置应该在像 $location =("/location").

这样的变量中

现在我的输出正在根文件夹中生成。

$sql=mysql_query("SELECT * FROM `client_details` ORDER BY `c_id` DESC LIMIT 1");  

while($data = mysql_fetch_array($sql))   
{ 
    $name=$data['name'];
}

$name_p = $name."-estimation.pdf";
$mpdf->Output($name_p,'F');
$mpdf->Output("/absolute/path/to/directory/" . $name_p,'F');

$mpdf->Output("relative/path/to/directory/" . $name_p,'F');
$path = __DIR__.'/../../files/'; //til you're at the location of upload 
/*
//you can use, will return false if incorrect path
die(realpath($path to make sure you are at the right level))
*/
//concatenate file path to your file name 
$mpdf->Output($path.$name_p,'F');