I need a little help figurig out the best method to do something...
I have written a PHP program that allows the user of a site I am building to upload a tab delimited file (CSV) to his site, PHP parses the file using fgetcsv() and then puts the data into his database. It works great.
HOWEVER...
I guess, some of this guy's files that he wants to process are given to him in SPACE DELIMITED (as in the columns all line up in monospaced type) files rather than tab or comma delimited format. They are also too big to load into excel and convert to CSV format.
SO...
I need to make a way for him to upload and process them in the original format of space delimited.
QUESTION...
is fgetcsv() still the best function to use for this, and if so, what "delimiter" charactor do I put in the function? (what would be the equivalent for multiple spaces of various lengths?)... or is there a different function or set of functions I should use? I see that there is other "get" functions like fgetc, fgets, fgetss... and I htink that in conjection with an explode oe implode function I could parse out the spaces and get the data into order... but I have searced php sites and Google for examples of how to do this and have found nothing good to go off of. Does anyone have an example or a concept of how to do this best?
Thanks!
GF