[Solved] PHP – Showing different text between different dates (3 Different Text to be shown)


Hello Akshat please find the simplified solution below

<?php 
$current_date = date('Y-m-d');
if(strtotime($current_date)>strtotime('2015-01-01') && strtotime($current_date)<strtotime('2015-04-01'))
{
    echo "TERM 1";
}
elseif(strtotime($current_date)>strtotime('2015-04-20') && strtotime($current_date)<strtotime('2015-06-01'))
{
    echo "TERM 2";
}
elseif(strtotime($current_date)>strtotime('2015-07-01') && strtotime($current_date)<strtotime('2015-10-31'))
{
    echo "TERM 3";
}
?>

I have tested it and its working fine

1

solved PHP – Showing different text between different dates (3 Different Text to be shown)