我正在使用以下功能导出为CSV。
$this->dbutil->csv_from_result()
不幸的是,在行的末尾打印分隔符,当我使用CSV再次导入数据时,它将其作为带有out键的字段。例子在这里:
" id"," time"," name",
" 1"," 1400000000"," John",
" 2"," 1400000000"," Matt",
想知道是否有人可以提供帮助。
答案 0 :(得分:0)
您只需使用
即可 rtrim($string, ","); // this will strip the comma from the end of the string
示例:
$string = "abc" ;
echo rtrim( $string , "c") ;
It will echo ab