Last active
August 16, 2024 08:02
-
-
Save JeffreyWay/25076f684a3e1cba9869772095b166fd to your computer and use it in GitHub Desktop.
PHP For Beginners, Episode 5 - Conditionals and Booleans
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Demo</title> | |
</head> | |
<body> | |
<h1> | |
<?= 'Hello World' ?> | |
</h1> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Demo</title> | |
<style> | |
body { | |
display: grid; | |
place-items: center; | |
height: 100vh; | |
margin: 0; | |
font-family: sans-serif; | |
} | |
</style> | |
</head> | |
<body> | |
<?php | |
$name = "Dark Matter"; | |
$read = true; | |
if ($read) { | |
$message = "You have read $name"; | |
} else { | |
$message = "You have NOT read $name"; | |
} | |
?> | |
<h1> | |
<?= $message ?> | |
</h1> | |
</body> | |
</html> |
{ "background_color": "purple", "description": "Shows random fox pictures. Hey, at least it isn't cats.", "display": "fullscreen", "icons": [ { "src": "icon/fox-icon.png", "sizes": "192x192", "type": "image/png" } ], "name": "Awesome fox pictures", "short_name": "Foxes", "start_url": "/pwa-examples/a2hs/index.html" }
<title>Hello World</title>
$name = "Jungle Book";$read =true;
if($read){
$message = "You have read $name";
}
else{
$message = "You have not read $name";
}
?>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mah