PHP code example of gabrielkaputa / bitly

1. Go to this page and download the library: Download gabrielkaputa/bitly 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/ */

    

gabrielkaputa / bitly example snippets




$bitly = \GabrielKaputa\Bitly::withGenericAccessToken(GENERIC_ACCESS_TOKEN);
$short_url = $bitly->shortenUrl($long_url);



$bitly = \GabrielKaputa\Bitly::withCredentials(CLIENT_ID, CLIENT_SECRET, USERNAME, PASSWORD);
$short_url = $bitly->shortenUrl($long_url);