I know this might ma a simple question, it must have been answered before but it’s the kind of question you don’t know how to google for.
I’m doing an intranet and I have a big texarea in wich te user pastes a 5columns X 365 rows (an optional first column with the 1 to 365 numbers) from excel and ends up in this:
1 $ 37 $ 74 $ 111 $ 148 $ 185
2 $ 37 $ 74 $ 111 $ 148 $ 185
3 $ 37 $ 74 $ 111 $ 148 $ 185
4 $ 37 $ 74 $ 111 $ 148 $ 185
5 $ 37 $ 74 $ 111 $ 148 $ 185
6 $ 57 $ 114 $ 171 $ 228 $ 285
7 $ 57 $ 114 $ 171 $ 228 $ 285
8 $ 57 $ 114 $ 171 $ 228 $ 285
9 $ 57 $ 114 $ 171 $ 228 $ 285
10 $ 57 $ 114 $ 171 $ 228 $ 285
How can I turn this into a php array so I can then insert it into a mysql table?
I tought about using explode() but I’m not sure if the space between each column will always be the same, maybe there’s a fancier way to do this.
If this is already discussed somewhere else just point me to it.
Thanks a lot
Explode per ligne
'\n'and then per column'\t'and just ignore the$