Codeigniter Write_file Question
Posted
by Brad
on Stack Overflow
See other posts from Stack Overflow
or by Brad
Published on 2010-03-13T16:34:36Z
Indexed on
2010/03/13
16:45 UTC
Read the original article
Hit count: 230
php
|codeigniter
I am writing to a txt file to back up certain posts. Here is my simple code
$this->path = APPPATH . "post_backups/";
$string = $this->input->post('post');
$post_title = $this->input->post('post_title');
$this->file = $this->path . $post_title."txt";
write_file($this->file, $string);
$this->index();
Every thing works fine except this
$this->file = $this->path . $post_title."txt";
I am trying to name my file with the title of the post IE: title.txt.
What I am getting it s this "titletxt". How should the $post_title . "txt" be written to provide txt as an extension?
Thanks
© Stack Overflow or respective owner