我的页面上已经有一个从 curl 生成 url 的函数。我需要使用以下字符串以文本格式或使用 shortswitch.com api 的“简单”返回短 url。
这是我的代码:
<?php
$long_url = urlencode('curPageURL()');
$url = "http://api.shortswitch.com/shorten?apiKey=[apikey]&format=simple&longUrl={$long_url}";
$result = file_get_contents($url);
print_r($result);
?>
我正在尝试使用我为 bit.ly 找到的功能与 shortswitch.com api 一起使用作为 shortswitch.com/admin/api。
我的问题是我没有从函数中获得任何类型的输出,也没有生成缩短的 url。
最好的祝福,