php - 一次获得多个结果
问题描述
我的代码通过在 .htm 之前获取 ID 来工作,我希望它与一行中的多个链接而不是 1 x 1
如果有人想看看它是如何工作的:https ://cleberrafael.com.br/freepik/fp.php
<?PHP
if (isset($_POST['execute']))
{
if ($_SESSION['token'] == $token) {
$url = $_POST['url'];
$stepOne = explode("_", $url);
if(!empty($stepOne[1])){
$stepTwo = explode(".htm", $stepOne[1]);
if(!empty($stepTwo[0])){
$id = $stepTwo[0];
$status = "success";
$msg = "https://www.freepik.com/download-file/".$id;
}
else {
$status = "warning";
$msg = "Cannot Parse URL";
}
}
else {
$status = "warning";
$msg = "Link Errado Amigo";
}
if ($status == "success") {
echo '<div class="alert alert-'.$status.'">
<strong>Pronto LIND!</strong> '.$msg.'
</div>';
} else if($status == "warning") {
echo '<div class="alert alert-'.$status.'">
<strong>Failed!</strong> '.$msg.'
</div>';
} else {
echo '<div class="alert alert-danger">
<strong>Error!</strong> UNKNOWN
</div>';
}
} else {
echo '<div class="alert alert-danger">
<strong>Invalid Token!</strong> ^_^.
</div>';
}
}
?>
解决方案
推荐阅读
- android - 如何转换 ArrayList
到一个\数组 在科特林 - c# - 无法连接到 Web 服务器 IIS Express - ASP.NET CORE
- networking - 简单滑动窗口协议示例结果分析
- python - 前向填充熊猫数据框中的自定义值
- caching - 是否有半共享缓存之类的东西?
- firebase - Firebase 云功能部署 - 无效的内存属性
- php - 如何创建一个以数据库函数为源的雄辩模型?
- excel - 要在 ComboBox 中列出的多列和偏移数组
- vuetify.js - 如何编辑 Vuetify 的分组标题
? - automated-tests - 如何使用赛普拉斯检查 URL 内容