PHP code example of chowjiawei / short-link

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

    

chowjiawei / short-link example snippets


$shortLinkService=new \Chowjiawei\ShortLink\Services\ShortLinkService();

$shortLinkService->short('apple122','maxLetter');

$shortLinkService->customShort('apple1111','apple123');

$shortLinkService->deleteOldUrl('apple122');

$shortLinkService->deleteNewUrl('apple122');

$shortLinkService=new \Chowjiawei\ShortLink\Services\ShortLinkService();
return  $shortLinkService->redirect();