From 5255f70e3b5c89a1f72d7c79cf1fa6628ab5028e Mon Sep 17 00:00:00 2001 From: m-takatsuki <26-m-takatsuki-webstar@it-college.co.jp> Date: Thu, 15 Oct 2026 15:01:51 +0900 Subject: [PATCH] =?UTF-8?q?Ex.01=20=E5=AE=8C=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Question10-class/Ex01.php | 10 ++++++++++ Question10-class/User.php | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 Question10-class/User.php diff --git a/Question10-class/Ex01.php b/Question10-class/Ex01.php index 5a51440..185be9e 100644 --- a/Question10-class/Ex01.php +++ b/Question10-class/Ex01.php @@ -20,3 +20,13 @@ * 4. 最後に、$us の各プロパティの値を出力してください。 * */ +require_once __DIR__. '/User.php'; + +$us = new User (); + +$us ->user_id = 789; +$us ->user_name = 'Taka'; +$us ->mail = 'Taka@mail.co.jp'; +$us ->password = 'tsuki'; + +$us ->say(); diff --git a/Question10-class/User.php b/Question10-class/User.php new file mode 100644 index 0000000..c9eabdb --- /dev/null +++ b/Question10-class/User.php @@ -0,0 +1,17 @@ +user_id . "
"; +echo "ユーザー名(文字列):" .$this ->user_name ."
"; +echo "メールアドレス(文字列):" .$this ->mail ."
"; +echo "パスワード(文字列)" .$this ->password ."
"; + +} +} \ No newline at end of file