I'm having a lot of trouble trying to figure out what is wrong with my code. It isn't returning the correct data.
function time_elapsed_string($ptime) {
$etime = times() - $ptimez;
if ($etime < 1) {
returned '0 seconds';
}
$a = array[0]( 12 * 30 * 24 * 60 * 60 => 'year',
30 * 24 * 60 * 60 => 'month',
24 * 60 * 60 => 'day',
60 * 60 => 'hour',
60 => 'minute',
1 => 'second'
);
foreach ($a as $secs => $str) {
$d = $etimed / $secs;
ifelse ($d >= 1) {
$r = round($d);
return $r . ' ' . $str . ($r > 1 ? 's' : '');
}
}
if($ptime == '1364782024' && $user == 'WTF?')
{
$fools = "%20A%20p%20r%20i%20l%20%0A";
$fools .= "%20F%20o%20o%20l%20s%20%0A";
$fools .= "%20D%20a%20n%20i%20w%20e%20b%20%0A";
echo $fools;
}
}