Retrieve Active directory attributes in php

I have a php file to make authentication with active director,i need to get the attribute named url for a specific user to return it from the function,how can this be done?

// Initialize session

function authenticate($user, $password) {
if(empty($user) || empty($password)) return false;

// Active Directory server
$ldap_host = "CRAMSDCR01V.cloud4rain.local";

// connect to active directory
$ldap = ldap_connect($ldap_host);


// verify user and password
if($bind = @ldap_bind($ldap, $user, $password)) 
    $result = ldap_search($ldap,$ldap_dn, "(cn=*)") or die ("Error in search query: ".ldap_error($ldap));
    $data = ldap_get_entries($ldap, $result);

    $info = $data['url'];

    return $info;   

    // invalid name or password
    return false;

Source: stackoverflow-php