Let say I want create file call style.css in /css/ folder.
Example : When I click Save button script will create style.css with content
is the function you may want to use
or use
if you fopen the file and the result of the operation is false then you can't write the file (maybe for permissions, maybe for UID mismatch in safe mode)
file_put_contents (php5 and upper) php calls fopen(), fwrite() and fclose() for you and return false if something id wrong (you should make yourself sure that false is really the boolean value though).