Download the PHP package service-to/base without Composer
On this page you can find all versions of the php package service-to/base. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download service-to/base
More information about service-to/base
Files in service-to/base
Download service-to/base
More information about service-to/base
Files in service-to/base
Vendor service-to
Package base
Short Description Library to convert integers to base62 strings, useful for shortURLs based on ID numbers in a database.
License MIT
Homepage https://github.com/ServiceTo/Base
Package base
Short Description Library to convert integers to base62 strings, useful for shortURLs based on ID numbers in a database.
License MIT
Homepage https://github.com/ServiceTo/Base
Keywords base62
Please rate this library. Is it a good library?
Informations about the package base
Base
Library to convert integers to base62 strings, useful for shortURLs based on ID numbers in a database.
Usage
Install using composer...
composer require "service-to/base"
In a Laravel Controller
Route::get('{shortcode}', function ($shortcode) {
$base = new ServiceTo\Base();
return View::make("content")->withArticle(App\Article::find($base->base2int($shortcode)));
});
In plain old PHP
require_once("vendor/autoload.php");
use ServiceTo\Base;
function shorturl($url) {
$myshortdomain = "http://short.long.urls.3.14159.xyz/";
$base = new Base();
$stmt = $pdo->prepare("INSERT INTO shorturls SET url=?");
$stmt->bindValue(1, $url, PDO::PARAM_STR);
$stmt->execute();
return($myshortdomain . $base->int2base($stmt->lastInsertId()));
}
All versions of base with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.3.0
The package service-to/base contains the following files
Loading the files please wait ....