PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Zhao  >  Bijection URL shortening  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: demo for short url
Class: Bijection URL shortening
Encode and decode values for short URLs
Author: By
Last change:
Date: 7 years ago
Size: 349 bytes


Class file image Download

use rbib\util\string\encode\Bijection;


$bijection = (new Bijection());
//create short url based on int(100)
$encode_id = $bijection->encode(100);
$encode_id; //aNbC

//decode the short url to int (100)
$decode_id = $bijection->decode($encode_id);
$decode_id; //100

For more information send a message to info at phpclasses dot org.