예제 #1
0
    // Print or do what you want with the information.
    //
    echo '<pre>';
    var_dump($tlds);
    echo '</pre>';
} catch (Exception $e) {
    echo $e->getMessage();
}
/*
 * ---------------------------------------------------
 * Method 3
 * ---------------------------------------------------
 */
try {
    // Instantiate DomainTools
    //
    $dt = new DomainTools();
    // Instantiate the servers library.
    //
    $servers = $dt->servers();
    // Get the common tlds.
    //
    $tlds = $servers->tlds('common');
    // Print or do what you want with the information.
    //
    echo '<pre>';
    var_dump($tlds);
    echo '</pre>';
} catch (Exception $e) {
    echo $e->getMessage();
}