Help Creating and understanding the IF and ELSEIF statements


#1

I try to learn my first IF statements and have run into some trouble. Below is my code and I’m trying to make a simple if it’s this date then display the holiday name:

<?php
	$holiday = date("F d");

	if ($holiday = "January 1") {
		echo "Happy New Year";
		}
		elseif ($holiday = "Feburary 14") {
		echo "Happy Valentines Day";
		}
		else {
		echo "Nothing";
		}
?>

#2

Simply use == instead of = to perform a comparison. A single equal is an assignation.


#3

Thank you very much. That worked.