762 views
Shorten a URL using PHP and is.gd
This is a really easy way to shorten URLs with PHP, using services like is.gd:
PHP
- /**
- * Shortens a url using the url shortening service "is.gd"
- *
- * @param string $original The original URL
- * @return string the shortened version of the original URL
- */
- static public function shortenUrl($original)
- {
- }
If you want to improve a little bit this function, you probably shoud check if the server responds with a 200 or a 500 code.
Submitted by miguelSantirso over 2 years ago — last modified less than a minute ago