title: How to write data into .txt file in codeigniter
body: <p>I have a folder in assets name is login.My doubt is what how to set the path.</p>
  
  <pre><code>$data=$id.'~'.$expense_type.'~'.$amount.'~'.$exp_date.'&lt;br&gt;';
  
  $todate= date('Y-m-d');
  echo $todate;
  if ( ! write_file('.../assets/login/log_'.$todate.'.txt', $data))
  {
  echo 'Unable to write the file';
  }
  else
  { 
  echo 'File written!';
  }
  </code></pre>
  
  <p>No problem about the data but the path is wrong i set</p>
  
  <blockquote>
    <p>my path is 'localhost/project/pro/application/assets/login/(specific
    .txt file)'</p>
  </blockquote>
  
  <p>Output is Unable to write the file</p>