100°F = 37.78°C
5 squared = 25
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PHP Functions</title>
<link rel="stylesheet" href="../css/assignmentHeaderStyles.css" />
</head>
<body>
<?php
include('../header/assignmentHeader.php');
error_reporting(E_ALL);
function toCelsius(float $fahrenheit): float {
return ($fahrenheit - 32) * 5 / 9;
}
function square(float $number): float {
return $number * $number;
}
function makeUppercase(string $text): string {
return strtoupper($text);
}
function countCharacters(string $text): int {
return strlen($text);
}
echo "<h1>PHP Functions</h1>";
echo "<h2>1. Temperature Conversion</h2>";
echo "<p>100°F = " . round(toCelsius(100), 2) . "°C</p>";
echo "<h2>2. Square a Number</h2>";
echo "<p>5 squared = " . square(5) . "</p>";
show_source(__FILE__);
include('../footer/footer.php');
?>
</body>
</html>