acctman Posted September 15, 2008 Share Posted September 15, 2008 How would I print a files content to a variable? I have a file reg_confirm.tpl that has HTML inside and I want the content stored in a $message variable for inputting into the mail() function Link to comment https://forums.phpfreaks.com/topic/124279-output-file-to-a-variable/ Share on other sites More sharing options...
Wuhtzu Posted September 15, 2008 Share Posted September 15, 2008 Hey Use the file_get_contents() function http://us2.php.net/filegetcontents <?php $file = 'some/path/reg_confirm.tpl'; $content = file_get_contents($file); echo $content; // Outputs everything from your file ?> Link to comment https://forums.phpfreaks.com/topic/124279-output-file-to-a-variable/#findComment-641761 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.