CSV files are just files with comma delimited values, nothing special.
To read from them, use fgetcsv()
http://www.php.net/manual/en/function.fgetcsv.php
to write to them, just print all the values on each line seperated by a comma (or whatever your file uses as a seperator. You may have to put quotes around the values if they contain commas themselves.