以下代码的作用只是调用第三方防红接口生成短接,防红接口请自行寻找。

请求方式:http://localhost/test.php?url=要缩短的链接
返回示例:http://suo.im/XXXX

<?php
$url = $_GET['url']; // 获取缩短的链接
$dwz = "https://api.uomg.com/api/long2dwz?dwzapi=suoim&url=";  // 网上抓的防红接口
$url = $dwz . $url;  // 拼接完整请求URL
$json_Array = json_decode(file_get_contents($url), true);
echo $json_Array['ae_url'];  // 返回短链

Never give up your dreams.