<?php function myccc($url) { $ccurl = "http://tinyurl.com/api-create.php?url=".$url; $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $ccurl); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); $MySources = curl_exec ($ch); curl_close($ch); return $MySources; } ?>
<?php $url = $_GET['url'] echo myccc($url); ?>
文章评论
有个演示,多好
@Andrew 这个很简单的,只要另存为php文件运行
xxx.php?url=http://www.zhaoxinpeng.com
这种就可以了