Ho fatto questo script per adesso
codice:
<?php
$headers = array("code","type","description","amount","expiry_date","enable_free_shipping","minimum_amount","maximum_amount","individual_use",
"exclude_sale_items","products","exclude_products","product_categories","exclude_product_categories","customer_emails","usage_limit",
"limit_usage_to_x_items","usage_limit_per_user","usage_count");
$data = $array (
array(
"code" => "spring10",
"type" => "fixed_cart",
"description" => "$10 off when you buy clothing; order over $25",
"amount" => "10",
"expiry_date" => " ",
"enable_free_shipping" => " ",
"minimum_amount" => "25",
"maximum_amount" => " ",
"individual_use" => "yes",
"exclude_sale_items" => "yes",
"products" => " ",
"exclude_products" => " ",
"product_categories" => "clothing",
"exclude_product_categories" => " ",
"customer_emails" => " ",
"usage_limit" => "500",
"limit_usage_to_x_items" => " ",
"usage_limit_per_user" => "1",
"usage_count" => " ",
),
);
$fh = fopen ("test.csv","w");
fputcsv ($fh, $headers);
foreach ($data as $fields) {
fputcsv($fh, $fields);
}
fclose($fh);
?>
Ma se metto i delimitatori
codice:
fputcsv(
resource $handle,
array $fields,
string $separator = ",",
string $enclosure = '"',
string $escape_char = "\\"
): int|false
Me li segna tutti come errori.