no message

This commit is contained in:
a-kizaki
2026-10-06 12:10:09 +09:00
commit 9c2090ffa2
156 changed files with 14850 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
<?php
// area.php:Ex03用
/**
* 四角形の面積:縦×横
*/
function calcRectangle($height, $width)
{
return $height * $width;
}
/**
* 三角形の面積:縦×横/2
*/
function calcTriangle($height, $width)
{
return ($height * $width) / 2;
}

View File

@@ -0,0 +1,9 @@
<?php
// escape.php:Ex02用
/**
* 文字列をエスケープする関数
*/
function h($str)
{
return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');
}

View File

@@ -0,0 +1,6 @@
<?php
// hello.php:Ex01用
function getMessage()
{
return "Hello, world!";
}

View File

@@ -0,0 +1,12 @@
<?php
// Util/redirect.php:Ex04/Ex05共通用
/**
* 指定したURLへリダイレクトする関数
*
* @param string $url リダイレクト先URL
*/
function redirect($url)
{
header("Location: " . $url);
exit;
}

View File

@@ -0,0 +1,14 @@
<?php
// Util/validate.php:Ex05用
/**
* ユーザー認証チェック関数
* ユーザー名が "admin"、パスワードが "secret" の場合のみ認証成功
*
* @param string $username
* @param string $password
* @return bool 認証成功ならtrue
*/
function checkUser($username, $password)
{
return ($username === 'admin' && $password === 'secret');
}