php - How to write data into .txt file in codeigniter -
i have folder in assets name login.my doubt how set path.
$data=$id.'~'.$expense_type.'~'.$amount.'~'.$exp_date.'<br>'; $todate= date('y-m-d'); echo $todate; if ( ! write_file('.../assets/login/log_'.$todate.'.txt', $data)) { echo 'unable write file'; } else { echo 'file written!'; }
no problem data path wrong set
my path 'localhost/project/pro/application/assets/login/(specific .txt file)'
output unable write file
use apppath
. path application folder
if ( ! write_file(apppath."assets/login/log_$todate.txt", $data))
Comments
Post a Comment