when user allow permission & script start processing every data is shown perfectly but i get error
PHP Notice: Undefined index: gd$email in
here is my php code
if (!empty($contacts['feed']['entry']))
{
foreach($contacts['feed']['entry'] as $contact)
{
// retrieve user photo
if (isset($contact['link'][0]['href']))
{
$url = $contact['link'][0]['href'];
$url = $url . '&access_token=' . urlencode($accesstoken);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_TIMEOUT, 15);
curl_setopt($curl, CURLOPT_VERBOSE, true);
$image = curl_exec($curl);
curl_close($curl);
}
if ($image === 'Photo not found')
{
// retrieve Name and email address
$return[] = array(
'name' => $contact['title']['$t'],
'email' => $contact['gd$email'][0]['address'],
'img_url' => '//cdn.twkcdn.com/profile/image/avatar.png?w=40&h=40&cf',
);
}
else
{
// retrieve Name and email address
$return[] = array(
'name' => $contact['title']['$t'],
'email' => $contact['gd$email'][0]['address'],
'img_url' => $url,
);
}
}
$google_contacts = $return; //returning all d
}
This is just example of half script & i don't know why fetching contacts from google take about 15 to 20 seconds everytime i visit this page