I have written a PHP class that gets the headers from a .xls spreadsheet and creates a table with those headers as column names.
It also gets each row of data from the spreadsheet and places them into an array.
What I would then like to do, is determine the best data type for each column in the row. It's mostly going to be text but there will be numbers in there, say for example £1,000 this would need to be saved as 1000 and be a int rather than a string.
It needs to be done dynamically as each spreadsheet has different column names and data in different orders.
I don't really know how to go about this, I was thinking maybe a for each loop and preg_match?
Any ideas are very much appreciated.