File name
Commit message
Commit date
File name
Commit message
Commit date
<?php
class Student
{
// 멤버변수 선언
private $name;
private $age;
private $number;
private $depart;
private $phone;
// 생성자 (인스턴스 생성 시 최초 1회 실행)
public function __construct($name, $age, $number, $depart, $phone) {
$this -> name = $name;
$this -> age = $age;
$this -> number = $number;
$this -> depart = $depart;
$this -> phone = $phone;
}
// In PHP 함수 리턴 값 표시 X 가능
function introduce() {
echo "Hi My name is <strong>" . $this->name . "</strong>.<br>";
echo "Age is <strong>" . $this->age . "</strong> and depart is <strong>" . $this->depart . "</strong>.<br>";
echo "Student number is <strong>" . $this->number . "</strong>.<br>";
echo "Also My Cell Phone number is <strong>" . $this->phone . "</strong>.";
}
}