Yes, it's a simple question, but one that I can't find a answer for through the PHP documentation or Google. (I'm just learning PHP....)
If this works:
<?php $d=date("D"); if ($d="Mon") { ?>echo this text on Monday<?php endwhile; ?><?php } else { ?><?php } ?>
Why doesn't this?
<?php $d=date("D"); if ($d="Mon,Tue") { ?>echo this text on Monday and Tuesday<?php endwhile; ?><?php } else { ?><?php } ?>
Do I need different delimiters between Mon and Tue? I've tried || and && ....
Thanks, Mark
You're performing an assignment of $d
when you say ($d="Mon")
. What you want is the comparison operator (==
):
if ($d == "Mon" || $d == "Tue")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With