PHP code example of dotzero / googl

1. Go to this page and download the library: Download dotzero/googl library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dotzero / googl example snippets


try {
    $googl = new \dotzero\Googl('YOUR_GOOGLE_API');
    echo $googl->shorten('http://github.com');
} catch (\dotzero\GooglException $e) {
    printf('Error (%d): %s', $e->getCode(), $e->getMessage());
}

try {
    $googl = new \dotzero\Googl('YOUR_GOOGLE_API');
    echo $googl->expand('http://goo.gl/KkZ8');
} catch (\dotzero\GooglException $e) {
    printf('Error (%d): %s', $e->getCode(), $e->getMessage());
}