Provides various official and user-released code examples, code reference, you are welcome to exchange and learn //////////////////////////////////// /// // get the T of Sina Weibo URL
// Http://open.weibo.com/wiki/2/short_url/shorten
// Http://open.weibo.com/wiki/Help/error
// Http://open.weibo.com/wiki/2/account/rate_limit_status New Version
//////////////////////////////////////// /// // Get the t url link of Sina Weibo
// Http://open.weibo.com/wiki/2/short_url/shorten
// Http://open.weibo.com/wiki/Help/error
// Http://open.weibo.com/wiki/2/account/rate_limit_status New Version
Function GetTurl ($ url = ''){
Set_time_limit (0 );
// $ TApi = "https://api.weibo.com/2/short_url/shorten.json? Access_token = [your token] & url_long = ";
$ TApi = "https://api.weibo.com/2/short_url/shorten.json? Source = [Your appkey] & url_long = ";
$ TApi = $ tApi. urlencode ($ url );
$ Ret = file_get_contents ($ tApi );
$ Ret = json_decode ($ ret, true );
If ($ ret ['error']) return $ url;
If (is_array ($ ret ['urls']) {
$ R = $ ret ['urls'] [0] ['url _ short '];
Return $ r;
}
Return $ url;
}
From: http://www.55lm.net/
AD: truly free, domain name + VM + enterprise mailbox = 0 RMB