PHP code example of havenstd06 / limg-php-client
1. Go to this page and download the library: Download havenstd06/limg-php-client 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/ */
havenstd06 / limg-php-client example snippets
use Havenstd06\Limg\Client as Limg;
$token = "abcdef1234";
Limg::setApiToken($token);
$img = Limg::upload('./images/test.png', $title = null);
$getSuccess = $img->getSuccess(); // true || false
$getStatus = $img->getStatus(); // 200
$getTitle = $img->getTitle(); // "Image uploaded from Client-PHP-Client"
$getDatetime = $img->getDatetime(); // "1626435783"
$getDate = $img->getDate(); // "2021-07-16 11:34:54"
$getType = $img->getType(); // "image/jpeg"
$getUserId = $img->getUserId(); // 2
$getUsername = $img->getUsername(); // "Havens"
$getState = $img->getState(); // 2
$getDeleteLink = $img->getDeleteLink(); // "https://limg.app/api/images/delete/xxxxxx"
$getPageLink = $img->getPageLink(); // "https://limg.app/i/xxxxxx"
$getLink = $img->getLink(); // "https://limg.app/i/xxxxxx.xxx"
bash
composer