코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>PHP DataType</title> </head> <body> <?php class Lecture { function Lecture() { $this->lec_01 = "PHP"; $this->lec_02 = "MySQL"; } } $var = new Lecture; // 객체 생성 echo $var->lec_01; // 객체의 속성 접근 echo "<br>"; echo $var->lec_02; ?> </body> </html>