php - codeigniter $this->dbutil->csv_from_result ignore last delimiter -
i using following function export csv.
$this->dbutil->csv_from_result()
unfortunately @ end of line prints delimiter, when use csv import data again takes field out key. example here:
"id", "time", "name",
"1", "1400000000", "john",
"2", "1400000000", "matt",
wondering if can this.
you can use
rtrim($string, ","); // strip comma end of string
example :
$string = "abc" ; echo rtrim( $string , "c") ; echo ab
Comments
Post a Comment