您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP实现短网址开源API 不需要数据库_PHP教程

2024/3/9 18:19:43发布31次查看
[php] 
配置文件 
[php]
主要代码
[php] 
0){ 
//$url = http://1dnet.net/index.php?api=1&return_url_text=1&longurl=.$_get['url'];  
$url=http://qita.in/app.php?api=.api_key.&type=noad&url=.$_get['url'];  
$ch = curl_init();  
$timeout = 5;  
curl_setopt($ch, curlopt_url, $url);  
curl_setopt($ch, curlopt_returntransfer, 1);  
curl_setopt($ch, curlopt_connecttimeout, $timeout);  
//在需要用户检测的网页里需要增加下面两行  
//curl_setopt($ch, curlopt_httpauth, curlauth_any);  
//curl_setopt($ch, curlopt_userpwd, us_name.:.us_pwd);  
$contents = curl_exec($ch);  
eregi('http://qita.in/(.*)',$contents,$new); 
curl_close($ch);  
if(strlen($contents)$shorturl=请输入正确的短网址; 

$shorturl=site./$new[1]; 
//echo [统计]; 
//echo '';  

?> 

7898.org免费短地址
免费短地址
缩短、分享及监测你的链接
短链接  
    原始网址
作者:liangxunli
http://www.bkjia.com/phpjc/478059.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/478059.htmltecharticle[php] 配置文件 [php] ?php /*网址设置*/ define(site,http://xxx.com);//域名后面不要加/ /*api设置*/ define(api_key,);//api,申请地址:http://qita.in/reg.php /*高级...
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product