I have a plain text file, containing emails in the following format:
"Name Surname" <name.surname@exmaple.com>, 'Name2 Surname2" <name2.surname2@example.com>, ...
Note: there are two spaces between each name-email pair. The whole file is on a single line.
How could I, using PHP, extract the data (only the email is necessary, but the name would be nice too) and insert it in an SQL database (assuming $dbc as the SQL Connection Object)?
1 Answer