$rtf=<<<RTF
{\rtf1
\b [TITLE] \b0\par
\b [MESSAGE] \b0\par
}
RTF;
$rtf = str_replace('[TITLE]',$valueTitle,$rtf);
$rtf = str_replace('[MESSAGE]',$valueMessage,$rtf);
After I have finished editing a rtf file in php like above, how do i save it with a new file name in a specific location for people to download?
You can save it with
file_put_contents()and simply offer the link to download, with the appropriate headers.Then you can either simply give them the direct download, or serve it with the right headers like this, useful if you need additional processing or access protection or something…