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
$data = "body {background:#fff;} a {color:#333; text-decoration:none; }"; if (false === file_put_contents('/css/style.css', $data)) echo 'Please chmod 777 to /css/ folder';