Turn a multidimensional array into a CSV string. The column names are created using the key values of the array.

array:to_csv(ARRAY $array, BOOL $include_header=TRUE)

array:to_csv([['name'=> 'tom', 'id' => 1, 'last_name' => ''],['name'=> 'bob', 'id' => 3, 'last_name' => 'burger']], TRUE)
#=> "name,id,last_name\ntom,1,\nbob,3,burger"

Copyright ©2013-2022 SunSed®. All rights reserved.