PHP If statement CODE
If the current day is Friday the code will output "Have a nice weekend!" PHP datetime format: https://www.php.net/manual/en/datetime.format.php
$d = date("D");
if ($d == "Fri"){
    echo "Have a nice weekend!";
}
If the current hour is less than 20, the code will output "Have a good day!"
$t = date("H");
if ($t < "20") {
  echo "Have a good day!";
}
If
$age
is more than
18
, prints
Adult
$age = 20;
if ($age > 18) {
	echo 'Adult';	
}
by Valeri Tandilashvili
2 years ago
PHP
If / else
4
Pro tip: use ```triple backticks around text``` to write in code fences