Marc wrote:
Is there a reason to force the double-quotes?
Not at all. With the note Benjamin sent yesterday, this part of the script should be rewritten this way:
// Handles the "separator" and the optionnal "enclosed by" characters if (!isset($sep)) { $sep = ''; } else if ($what == 'excel') { $sep = ';'; } else { if (get_magic_quotes_gpc()) { $sep = stripslashes($sep); } $sep = str_replace('\t', "\011", $sep); } if (!isset($enc_by)) { $enc_by = ''; } else if ($what == 'excel') { $enc_by = '"'; } else if (get_magic_quotes_gpc()) { $enc_by = stripslashes($enc_by); } if (!isset($esc_by)) { $enc_by = ''; } else if (($esc_by == '' && $enc_by !='') || $what == 'excel') { // double the "enclosed by" character $esc_by = $enc_by; } else if (get_magic_quotes_gpc()) { $esc_by = stripslashes($esc_by); }
At least, I think so!
Loïc
______________________________________________________________________________ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif
Thanks, it works now for my (ordinary) CSV case. Will you apply it?
Marc
Loïc a écrit :
Marc wrote:
Is there a reason to force the double-quotes?
Not at all. With the note Benjamin sent yesterday, this part of the script should be rewritten this way:
// Handles the "separator" and the optionnal "enclosed by" characters if (!isset($sep)) { $sep = ''; } else if ($what == 'excel') { $sep = ';'; } else { if (get_magic_quotes_gpc()) { $sep = stripslashes($sep); } $sep = str_replace('\t', "\011", $sep); } if (!isset($enc_by)) { $enc_by = ''; } else if ($what == 'excel') { $enc_by = '"'; } else if (get_magic_quotes_gpc()) { $enc_by = stripslashes($enc_by); } if (!isset($esc_by)) { $enc_by = ''; } else if (($esc_by == '' && $enc_by !='') || $what == 'excel') { // double the "enclosed by" character $esc_by = $enc_by; } else if (get_magic_quotes_gpc()) { $esc_by = stripslashes($esc_by); }
At least, I think so!
Loïc