I'm trying to create an form where the user can upload a datafile to the
server. The datafile will be txt or csv and contain multiple records. I
would like the user to supply the field delimiter like (,) comma , (\t)
tab or something else. The data records are then parsed using fgetcsv.

The problem I'm having is trying to recover the tab character from the
form post. If I print out what is received from my form I see the
following \\t. I realize that the addition of the extra slash is
expected, but what I don't know how to do is prepair this varable to use
it in my fgetcsv argument.

I've tried using stripslash but nothing seems to work for me.

Strangely, if is set a variable in my processing script like:

$field_terminater = "\t";

Then supply this to: $newRecord = fgetcsv($f, $size,$field_terminater)
everything works fine. If I use the variable passed from my form the
records are not getting parsed.

Any suggestions would be appreciated.
Chris



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to