Ex.01 完了
This commit is contained in:
@@ -20,3 +20,13 @@
|
|||||||
* 4. 最後に、$us の各プロパティの値を出力してください。
|
* 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();
|
||||||
|
|||||||
17
Question10-class/User.php
Normal file
17
Question10-class/User.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class User {
|
||||||
|
|
||||||
|
public $user_id;
|
||||||
|
public $user_name;
|
||||||
|
public $mail;
|
||||||
|
public $password;
|
||||||
|
|
||||||
|
public function say (){
|
||||||
|
echo "ユーザーID(整数):" .$this ->user_id . "<br>";
|
||||||
|
echo "ユーザー名(文字列):" .$this ->user_name ."<br>";
|
||||||
|
echo "メールアドレス(文字列):" .$this ->mail ."<br>";
|
||||||
|
echo "パスワード(文字列)" .$this ->password ."<br>";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user