php - How to write a string in pdf file on specific path.. DOMPDF -


i have function takes 2 parameters data(html),name. in function trying save data in pdf file on localhost/abc-folder. unfortunately runs fine don't write in specific file or so..

here code.

<?php function pdf($data, $name) {   if (count($name) > 1) {     $name = "orders";   } else {     $name = 'order_'.$name[0]['order_id'];   }    $pdf = new dompdf;   $pdf->load_html($data);   $pdf->render();   $str=$pdf->output();    $fp = fopen($_server['document_root'] . "/aabcd.pdf","wb");   fwrite($fp,$str);   fclose($fp); } ?> 


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -