codeigniter read or write a file
Filed Under (codeigniter, php) by admin on 02-11-2009
Tagged Under : codeigniter

In dealing with files on ci use the file helper
http://codeigniter.com/user_guide/helpers/file_helper.html
It is loaded using this line
$this->load->helper(‘file’);
read a file with read_file()
$data = read_file(‘./path/to/file.php’);
write a file with write_file();
write_file(‘./path/to/file.php’, $data, ‘w+’);
CI recommends “r+” but its better to use “w+”


