@ikoros92

Как реализовать показ и скрытие блока php по дате?

Есть блок <?php...?>
<?php
<div class="card">
                        <img class="card-img-top img-fluid" src="..." alt="Card image cap">
                        <div class="card-block">
                            <h4 class="card-title">Card title that wraps to a new line</h4>
                            <p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
                            <button type="button">Подробнее</button>
                        </div>
                    </div>
    
    
   ?>


, необходимо скрыть блок если дата, например (23.03.2019) прошла.
Есть вариант сравнения дат, но не могу сообразить как это воплотить в коде.
Перерыл пол интернета, так и не нашел ни чего подходящего. Заранее спасибо за помощь
  • Вопрос задан
  • 207 просмотров
Пригласить эксперта
Ответы на вопрос 1
@VisualIdeas
<?php if (date('Y.m.d')>'2019.03.23') { ?>
<div class="card">
                        <img class="card-img-top img-fluid" src="..." alt="Card image cap">
                        <div class="card-block">
                            <h4 class="card-title">Card title that wraps to a new line</h4>
                            <p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
                            <button type="button">Подробнее</button>
                        </div>
                    </div>
<?php } ?>
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы