Función para acortar URLs con PHP y TinyURL


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



Copy this code and paste it in your HTML
  1. <?php
  2. function acortar_url($url){
  3. $apiurl = "http://tinyurl.com/api-create.php?url=".$url;
  4. $url_corta = file_get_contents($apiurl);
  5. return $url_corta;
  6. }
  7. //Ejemplo de uso
  8. echo acortar_url("http://www.webintenta.com");
  9. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.