草庐IT

countholenfetch

全部标签

PHP:将秒转换为分钟和小时

我想将一定的秒数转换为分钟甚至小时。但我不想为每一分钟和每一小时等写一个if子句......我怎样才能以最简单的方式做到这一点,最简单的意思是最短。;)PHP:$countholen=mysqli_fetch_array(mysqli_query($db,"SELECT*FROM`blablabla`WHERE`blabla`='bla'"));$countholenfetch=$countholen["count"];if($countholenfetch60){$countholenfetch=$countholenfetch-60;$count="1min"."+".$count