PHP code example of samhk222 / tinyurl

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

    

samhk222 / tinyurl example snippets


$shortened = new Samhk222\TinyUrl\TinyUrl();
echo $shortened->shorten('very long url');

$shortened = Samhk222\TinyUrl\TinyUrl::token("your token here");
echo $shortened->shorten('very long url');