Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/248.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php codeigniter$此->;dbutil->;csv_from_结果忽略最后一个分隔符_Php_Codeigniter_Csv - Fatal编程技术网

Php codeigniter$此->;dbutil->;csv_from_结果忽略最后一个分隔符

Php codeigniter$此->;dbutil->;csv_from_结果忽略最后一个分隔符,php,codeigniter,csv,Php,Codeigniter,Csv,我正在使用以下功能导出到CSV $this->dbutil->csv_from_result() 不幸的是,在行尾它打印了分隔符,当我再次使用CSV导入数据时,它将它作为一个没有out键的字段。例如: “id”、“时间”、“姓名” “1”、“140000000”、“John” “2”,“140000000”,“马特” 想知道是否有人能帮上忙。您只需使用 rtrim($string,“,”);//这将从字符串末尾去掉逗号 例如: $string = "abc" ; echo rt

我正在使用以下功能导出到CSV

$this->dbutil->csv_from_result()
不幸的是,在行尾它打印了分隔符,当我再次使用CSV导入数据时,它将它作为一个没有out键的字段。例如:

“id”、“时间”、“姓名”

“1”、“140000000”、“John”

“2”,“140000000”,“马特”

想知道是否有人能帮上忙。

您只需使用

rtrim($string,“,”);//这将从字符串末尾去掉逗号

例如:

$string = "abc" ; 

echo rtrim( $string , "c") ; 

It will echo ab

我想知道最后一个分隔符。请参见每行末尾的逗号。$out=rtrim($out);已添加到“\system\database\DB\u utility.php”中