use file_put_contents function directly