PHP code example of leadthread / php-google-shortener

1. Go to this page and download the library: Download leadthread/php-google-shortener 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/ */

    

leadthread / php-google-shortener example snippets


use LeadThread\GoogleShortener\Google;
$c = new Google("token");
$result = $c->shorten("https://www.google.com/");
var_dump($result);
// string(21) "http://goo.gl/1SvUIo8"
bash
composer