Let say I want create file call style.css in /css/ folder.
/css/
Example : When I click Save button script will create style.css with content
style.css
http://php.net/manual/en/function.fwrite.php | Example 1