Posted By

khaled on 04/18/10


Tagged

url untiny Shortened


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

dantreacy


Retrieve The Original URL From A Shortened URL


 / Published in: PHP
 

URL: http://k-coder.blogspot.com/2010/04/php-function-to-retrieve-original-url.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. ?>

Report this snippet  

You need to login to post a comment.