Skip to content

monster3d/php-url-shortener

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP-Url-Shortener

Description:

This library for simple to take short url. Usind Google Shortener API.

Install this package with Composer

Require this package with Composer.

composer require monster3d/php-url-shortener

Or add your dependencies to composer.json file

"require": {
    "monster3d/php-url-shortener": "*"
    }

How to use:

<?php
//include composer
require __DIR__ . '/vendor/autoload.php';
use Monster3D\Shortener\Short;

//Set google api key
Short::setGoogleAPIKey('YOUR-GOOGLE-API-KEY');
$result = Short::link('http://mylongurl.ru/');
print_r($result);

in the var: $result will be stdClass object.

stdClass object
(
    [kind]    => urlshortener#url
    [id]      => https://goo.gl/VQ5T
    [longUrl] => http://mylongurl.ru/
)

About

Shortener url base on the Google Shortener API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%