Files
IWD2-02/INFO-1208 (PHP)/Notes/week_2_in_class.php
T
2026-03-06 21:27:16 -05:00

62 lines
1.2 KiB
PHP

<html lang="en">
<head>
<title>Week 2 Notes</title>
</head>
<body>
<?php
$globalVar = "I'm global!";
function greet($fname, $lname) {
echo("Hello, " . $fname . " " . $lname . "!");
}
function greet2($name = "Guest") {
echo("Hello, " . $name . "!");
}
function add($a, $b) {
return $a + $b;
}
function test() {
global $globalVar;
echo $globalVar;
}
greet("Levi", "McLean");
greet2();
$result = add(5, 3);
echo $result;
define("CENTS_IN_DOLLAR", 100);
$name = "Levi McLean";
echo("<p>Hello $name</p>");
$name = "Batman";
echo("<p>Hello $name</p>");
print_r($name);
echo "1231\"\"2321";
phpinfo();
$int = 1;
$float = 1.0;
$seasons = [
"Winter",
"Spring",
"Summer",
"Fall",
];
$years = [1, 2, 3, 4, 5];
$_SERVER = "Bob";
?>
</body>
</html>