variables - PHP MIN to exclude 0 value -


i have 3 numeric values want find the lowest value. use min(), this:

$last_activity = min($last_article, $last_comment, $last_video); 

is possible make min() exclude variable if value 0? note 3 variables simple strings number 10, not arrays...

no, min has no such option. you have option filter 0 values first:

min(array_filter([$last_article, $last_comment, $last_video])) 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -