https://ilinkshort.com/st?api=42ba16158d8da778a3eafdb05721ed8df3b3d7b4&url=yourdestinationlink.com
$long_url = urlencode('yourdestinationlink.com');
$api_token = '42ba16158d8da778a3eafdb05721ed8df3b3d7b4';
$api_url = "https://ilinkshort.com/api?api={$api_token}&url={$long_url}&alias=CustomAlias";
$result = @json_decode(file_get_contents($api_url),TRUE);
if($result["status"] === 'error') {
echo $result["message"];
} else {
echo $result["shortenedUrl"];
}
Comments
Post a Comment