Skip to content

Instantly share code, notes, and snippets.

@kejyun
kejyun / google_api_v3_get_contact.php
Created December 13, 2012 10:56
在PHP使用Google API(V3)取得使用者的Gmail通訊錄清單
<?php
function getEmailList($xml = '' , $access_token = '' , &$contact_list = array()) {
if (empty($xml)) {
return false;
}
$doc = new DOMDocument;
$doc->loadXML($xml);
$xpath = new DOMXPath($doc);
$contacts = $xpath->query("//gd:email");
// 撈取email跟姓名