php array strtotime query -


i have following code finds oldest date in array, , displays 'available now' if date today or earlier, or 'mixed availability' if date in future.

im trying modify if 1 valid date (not null or 1970-01-01 being imported if date blank) found in array, display date, or if date today or before today display 'available now'... id appreciate help! many in advance!

<?php $avail = array($this->item->extrafields->roomonedateavailable->value, $this->item->extrafields->roomtwodateavailable->value, $this->item->extrafields->roomthreedateavailable->value, $this->item->extrafields->roomfourdateavailable->value, $this->item->extrafields->roomfivedateavailable->value, $this->item->extrafields->roomsixdateavailable->value, $this->item->extrafields->roomsevendateavailable->value, $this->item->extrafields->roomeightdateavailable->value, $this->item->extrafields->roomninedateavailable->value, $this->item->extrafields->roomtendateavailable->value); $avail = array_filter($avail); $avail = min($avail); if (strtotime($avail) < time()) { ?><div class="pr-rd-avl-n">available<br /> now</div> <?php } else { ?><div class="pr-rd-avl-m">mixed<br /> availability</div> <?php } ?> 


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -