Retrieve The Original URL From A Shortened URL


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. function retrieve_shortened_link($shortUrl){
  3. $headers = get_headers($shortUrl, 1);
  4. if(is_array($headers['Location'])){
  5. return $headers['Location'][0];
  6. }else{
  7. return $headers['Location'];
  8. }
  9. }
  10. ?>

URL: http://k-coder.blogspot.com/2010/04/php-function-to-retrieve-original-url.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.