PHP短链接url还原成长链接
warning:
这篇文章距离上次修改已过191天,其中的内容可能已经有所变动。
在PHP中,可以使用urldecode()
函数来将短链接还原成长链接。以下是一个简单的例子:
$shortUrl = 'http%3A%2F%2Fexample.com%2Fstory%2F392%2F';
$longUrl = urldecode($shortUrl);
echo $longUrl; // 输出: http://example.com/story/392/
在这个例子中,$shortUrl
是一个经过URL编码的短链接。使用urldecode()
函数,我们将其转换回了原始的长链接,存储在$longUrl
变量中。
评论已关闭