Are you wanting a text file?
If so, do want it formatted as comma (or other) delimited or like an ini file, or do you just want to write $contents to as it is.
What format is $content in, string, array?
You're going to have to be a bit more specific if you want help.