powelly Posted January 13, 2008 Share Posted January 13, 2008 Im using fwrite to generate a php file with the following code: $Data = "</body> </html> <? // Output-Buffer in variable: $html=ob_get_contents(); // delete Output-Buffer ob_end_clean(); $pdf = new HTML2FPDF(); $pdf->DisplayPreferences('HideWindowUI'); $pdf->AddPage(); $pdf->WriteHTML($html); $pdf->Output('doc.pdf','I'); ?>"; fwrite($Handle, $Data); print "Data Written "; fclose($Handle); However its trying to write the contents of the variables rather than the variable names, so the output I get is: </body> </html> <? // Output-Buffer in variable: =ob_get_contents(); // delete Output-Buffer ob_end_clean(); = new HTML2FPDF(); ('HideWindowUI'); (); (); ('doc.pdf','I'); ?> Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/85793-php-get-fwrite-to-write-variable-names/ Share on other sites More sharing options...
tinker Posted January 13, 2008 Share Posted January 13, 2008 you need to escape the $, e.g. \$ Quote Link to comment https://forums.phpfreaks.com/topic/85793-php-get-fwrite-to-write-variable-names/#findComment-437870 Share on other sites More sharing options...
powelly Posted January 13, 2008 Author Share Posted January 13, 2008 you need to escape the $, e.g. \$ You Sir, are a star, thank you! Quote Link to comment https://forums.phpfreaks.com/topic/85793-php-get-fwrite-to-write-variable-names/#findComment-437872 Share on other sites More sharing options...
PFMaBiSmAd Posted January 13, 2008 Share Posted January 13, 2008 If you use single-quotes at the start and end of the $Date string (and then escape any single-quotes within the string), variables won't be parsed either. Quote Link to comment https://forums.phpfreaks.com/topic/85793-php-get-fwrite-to-write-variable-names/#findComment-437995 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.