PHP code example of drksh / slugger

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

    

drksh / slugger example snippets


// Transform ID's to slugs.
Darkshare\Slugger::encode(1); // a
Darkshare\Slugger::encode(81259151); // fUcod

// Transform slugs to IDs.
Darkshare\Slugger::decode('a'); // 1
Darkshare\Slugger::decode('fUcod'); // 81259151