I have an array.
if ( $date_month == $months['1'] ||
$date_month == $months['2'] ||
$date_month == $months['3'] ||
$date_month == $months['4'] ||
$date_month == $months['5'] ||
$date_month == $months['6'] ||
$date_month == $months['7'] ||
$date_month == $months['8'] ||
$date_month == $months['9'] ||
$date_month == $months['10'] ||
$date_month == $months['11'] ||
$date_month == $months['12']
) {
echo "its true";
}else{
echo "its false";
}
I want to echo the value of the one thats true. Currently I have to write if statements for each. Was wondering if there was a way to just echo which ever on is true in the conditional. Any help is greatly appreciated.