How to write variables to a file with file_put_contents (PHP)
<p>I am creating a posting system and when the author clicks submit, I need to create a new file (newpost.php) in the same directory. That file will contain the content of the post and the title, author, etc. I have variables for everything like $title, $content, etc. But I also need to add div tag's and things. How can I do that using fwrite or file_put_contents? Right now, I am using file_put_contents. So in the newpost.php file, it will automatically add <code>echo $content</code>, etc. But that doesn't work because as soon as I leave the page the variables get destroyed. I need it to be saved in plain text.</p>
