- glob: documentation ( source)
- round: documentation ( source)
- floor: documentation ( source)
- filesize: documentation ( source)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>probák, felvételek</title>
</head>
<body>
<br/>
<?php
$mbsize = 0;
$minutes = 0;
$wholeMinutes = 0;
$restOfMinutes = 0;
$filepath = '*.mp3';
$picarray = glob($filepath);
for ($i=0; $i<count($picarray); $i++):
$mbsize = round(filesize($picarray[$i])/1024/1024,1);
$minutes = round($mbsize/.686);
if ($minutes > 60):
$wholeMinutes = floor($minutes/60);
$restOfMinutes = $minutes - ($wholeMinutes * 60);
$showMinutes = $wholeMinutes.' óra '.$restOfMinutes;
else:
$showMinutes = $minutes;
endif; ?>
<a href="<?php echo $picarray[$i]; ?>" target="_blank"><?php echo $picarray[$i]; ?> (<?php echo $mbsize; ?> MB - kb. <?php echo $showMinutes; ?> perc)</a>
<?php if ($i < count($picarray)-1)
echo '<br/><br/>'; ?>
<?php endfor; ?>
</body>
</html>