I’ve finally started to learn PHP and I quite have trouble with it. I am trying to make a website change its stylesheet according to the moment of the day (day, twilight, night) and I’ve taken this approach:
<?php
$lt = localtime();
if ($lt[2]>=6 && $lt[2]<=16)
echo('<link href="style.css" rel="stylesheet" type="text/css" />');
elsif ($lt[2]>=17 && $lt[2]<=21)
echo('<link href="style_twilight.css" rel="stylesheet" type="text/css" />');
else
echo('<link href="style_night.css" rel="stylesheet" type="text/css" />');
?>
I get syntax error, unexpected T_ECHO in …../style_changer.php on line 12
What am doing wrong?
elseif/else if manual
Its
elseif(no space between else & if) notelsif