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