tinyurl api using curl returning blank

465 Views Asked by At

When I am trying below Code,l Its returning me Blank. Any Clue what could be the reason ?

<?php

function tiny_url($url){

$ch = curl_init();
$timeout = 5; 
curl_setopt($ch,CURLOPT_URL,'http://tinyurl . com/api-create.php?url='.$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE );
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}


echo tiny_url("www.google.com");


?>
0

There are 0 best solutions below