PHP code example of dominikveils / bitly

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

    

dominikveils / bitly example snippets




y = new DominikVeils\Bitly\Bitly('API KEY');

$short_url =  $bitly->shorten('https://google.com');
echo "SHORT URL: {$short_url}", PHP_EOL;
$long_url = $bitly->expand($short_url);
echo "LONG URL: {$long_url}", PHP_EOL;