The best way to read and write txt file

Hello, I’m newby in Yii.

So, I want to write txt file (with any info inside) and read it later.

I saw CFile class, but is it best way to do that? What else options exist in Yii?

And can you show me best practices when proccessing with files, any simple examples to start?

Thank you !

Yii is written in php so our good old friend "file_put_contents" and "file_get_contents" still works

http://php.net/manual/en/function.file-put-contents.php