Help Creating and understanding the IF and ELSEIF statements

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:

	$holiday = date("F d");

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

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

Thank you very much. That worked.

Sponsor our Newsletter | Privacy Policy | Terms of Service