This question already has an answer here:
- The 3 different equals 5 answers
I want to have a program that displays a certain phrase based on the day of the week, if it is friday, then it displays a certain phrase but when it is mon - thurs it displays a different phrase. Here is my code
<html>
<?php
$t=date('d-m-Y');
$time = date("D",strtotime($t));
echo $t;
echo $time;
if ($time = 'Fri')
{
$delivery = 'All meals ordered today will be delivered on Monday.';
}else{
$delivery = 'All meals ordered today will be delivered for tomorrow.';
}?>
<br><h1><?php echo $delivery;?>
The output always shows the first statement on the if statement.
Aucun commentaire:
Enregistrer un commentaire