View Full Version : Importing Gmail,Yahoo and Hotmail address book using PHP 5

October 13th, 2008, 07:47 AM
Hello all,

Can anybody tell me how to import gmail,yahoo and hotmail address book using PHP 5 as i need it to do a social network site.Any help will be highly appreciated.

Thanks in advance

October 13th, 2008, 12:36 PM
These email services can (all) export their addressbook as a CSV file. (List of rows of comma-separated-values). The Gmail service gives you (or rather your clients) help on how to do that, I suggest displaying the same step by step help in your upload form. ;)


Pre process the data by dissolving each line into an array of its values;
Strip delimiting quotes, if any.
$toParse = file($uploaded_a_book);
foreach($toParse as $k => $sentence) {
foreach($parsed as $n=>$p)
Process the data by querying the array using the (all numeric) keys to refer to data-items, in order.