PHP code example of choval / lid

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

    

choval / lid example snippets


/**
 * Basic usage
 */
$lid = new Lid( 21398 );
echo $lid->id();
// 1-5z8
echo $lid->web();
// 1_2H9V
echo $lid->number();
// 21398

/**
 * The constructor accepts an int, a LID or a Web LID
 */
$lid = new Lid( '1_2H9V' );
echo $lid->id();
// 1-5z8
echo $lid->web();
// 1_2H9V
echo $lid->number();
// 21398


/**
 * The constructor accepts long formats as well
 */
$lid = new Lid( '1000_0000_0000_2H9V' );
echo $lid->id();
// 1-5z8
echo $lid->web();
// 1_2H9V
echo $lid->number();
// 21398


/**
 * And the web format allows you to make mistakes with letters and nums
 */
$lid = new Lid( '1_zHqU' );
echo $lid->id();
// 1-5z8
echo $lid->web();
// 1_2H9V
echo $lid->number();
// 21398