@ 2014-02-27T16:31:26Z <?php
define('SECONDE', 1);
define('MINUUT', 60*SECONDE);
define('UUR', 60*MINUUT);
define('DAG', 24*UUR);
// Bezochtte tijd
function timetostr($tijd) {
$output = '';
$result['dag'] = (int) ($tijd/DAG);
$tijd = $tijd % DAG;
$result['uur'] = (int) ($tijd/UUR);
$tijd = $tijd % UUR;
$result['minuut'] = (int) ($tijd/MINUUT);
$tijd = $tijd % MINUUT;
$result['seconde'] = $tijd;
if ($result['dag'])
$output[] = $result['dag'] . ($result['dag'] == 1 ? ' dag' : ' dagen');
if ($output || $result['uur'])
$output[] = $result['uur'] . ($result['uur'] == 1 ? ' uur' : ' uren');
if ($output || $result['minuut'])
$output[] = $result['minuut'] . ($result['minuut'] == 1 ? ' minuut' : ' minuten');
$output[] = $result['seconde'] . ($result['seconde'] == 1 ? ' seconde' : ' seconden');
$return = join($output, ', ');
$return = preg_replace('/^(.*), ([^,]+)$/', '\\1 en \\2', $return);
return $return;
}
echo timetostr(12345);
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.1.0 - 7.1.25 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.6 Fatal error: Uncaught Error: [] operator not supported for strings in /in/IMYCc:20
Stack trace:
#0 /in/IMYCc(29): timetostr(45)
#1 {main}
thrown in /in/IMYCc on line 20
Process exited with code 255 . Output for 4.3.0 - 4.3.11 , 4.4.0 - 4.4.9 , 5.0.0 - 5.0.5 , 5.1.0 - 5.1.6 , 5.2.0 - 5.2.17 , 5.3.0 - 5.3.29 , 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.28 , 7.0.0 - 7.0.20 3 uren, 25 minuten en 45 seconden preferences:dark mode live preview
260.85 ms | 404 KiB | 371 Q