How would I transfer the contents of this text file into my database?
I have a client who was using a mailing list script that stored all the addresses in a .txt file with each address separated by a "%". Now I would like to transfer all of those addresses to a MySQL database. What do I need to do to loop through all the addresses and insert them into the database?
<?php
// get contents of a file into a string
$filename = "/usr/local/something.txt";
$handle = fopen($filename, "rb");
$contents = fread($handle, filesize($filename));
fclose($handle);
?>
now you can use explode here since you said emails separated by % so we do this..
Bookmarks