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
Post a Comment