[Plornt] commented on a Page, duration()  -  Apr 28, 2011

Its an inline if that checks if $measure is set AND its inside of the array. It then timeses $s by the number inside the array.

Its the same as:

$scale = array('minutes' => 60, 'hours' => 3600, 'days' => 86400, 'weeks' => 604800);
if (!empty($scale[$measure])) $s *= $scale[$measure];

if slightly expanding the if makes any more sense to you?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.