Instantly share code, notes, and snippets.

@sclaeys /api.php.php
Last active Jul 13, 2018

Embed
What would you like to do?
WEBZ.CC URL Shortener API PHP Request
<?php
// Using JSON Response
$api_url="http://webz.cc/api?key=APIKEY&url=THELONGURLTOBESHORTENED&custom=CUSTOMALIAS";
$res= @json_decode(file_get_contents($api_url),TRUE);
if($res["error"]){
echo $res["msg"];
}else{
echo $res["short"];
}
// Using Plain Text Response
$api_url="http://webz.cc/api?api=APIKEY&url=THELONGURLTOBESHORTENED&custom=CUSTOMALIAS&format=text";
$res= @file_get_contents($api_url);
if($res){
echo $res;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment