Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getShortUrl($url) {
- $ch = curl_init();
- curl_setopt($ch,CURLOPT_URL,'http://is.gd/api.php?longurl='.$url);
- curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
- curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5);
- $content = curl_exec($ch);
- curl_close($ch);
- return trim($content);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement