Create Digg Url with PHP


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

This function will convert any long url into a Diggbar url


Copy this code and paste it in your HTML
  1. function digg_url($longurl)
  2. {
  3. $simple = shell_exec('curl http://services.digg.com/url/short/create?url='. urlencode($longurl));
  4. xml_parse_into_struct($p, $simple, $vals, $index);
  5. return $vals[1]['attributes']['SHORT_URL'];
  6. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.