I am trying to input data from a text file into a MySQL database and would like to be able to input the data using a single script. What's the easiest way to parse a line, such as below, and turn it into variables to be placed in the database. While I can simply place the data in by importing from a file, it's not quite so easy. I only need to place some of the data in, plus I would like to split one of the fields. Below is an example of a line from the file, and then the variables that I need to enter.
Here is an example of a line from the file: Number,City,State,Country,Provider,Isdn,56K,CreateDate,Active,Timezone,ModDa te,ModNote 403 -770 -4904 ,CALGARY,AB,CAN,T2,Y,Y,Apr 29 2002 12:00:00:000AM,I,GMT-0700,, As for variables, I need the following: Split Number into $AreaCode & $Number > 403 & 770-4904 $City $State $Country Thanks for any help. Jason D. Williard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php