hey ya, just wondering now,

Is it possible to CHMOD a file / Set file permissions with PHP?

Cuz my web application needs to write sum values to a config file, & after its done, i would like to set the chmod to 755, and when i need to write to the file set it to 777...

anyhow, lemme no plz