PHP 下载时间计算器 源码

gettime.php 源码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

<html>
<head>
<meta charset="utf-8">
<title>下载时间计算器</title>
</head>
<body style="text-align:center;">

<form action="gettime.php" method="get">
下载速度(KB/s): <input type="text" name="speed">
文件大小(MB): <input type="text" name="size">
<input type="submit" value="开始计算">
</form>
<?php
$size = floatval($_GET["size"]);
$speed = floatval($_GET["speed"]);

$time = intval($size * 1024 / $speed);
if ($time > 0){
echo "下载速度: " . $speed . "(KB/s)\t 文件大小: " . $size . "(MB)<br>";
echo "下载所需时间: " . $time . "秒!<br>";
echo "换算时间: ". intval($time /3600) . "小时" . intval($time % 3600 / 60 + 0.5) . "分钟";

}
?>
</body>
</html>

转自蘭雅

🔰本文标题: PHP 下载时间计算器 源码

🔞本文链接: https://193.gs/xzsjjsq/index.html

🌡️本文总热度