<!DOCTYPE html>
<html>
<head>
<title>Reconstructing the Person Class</title>
<link type='text/css' rel='stylesheet' href='style.css'/>
</head>
<body>
<p>
<?php
class Person {
public $teacher;
public $student;
public $isAlive = true;
public $firstname;
public $lastname;
public $age;
public function __construct($firstname , $lastname, $age) {
$this->firstname = $firstname;
$this->lastname = $lastname;
$this->age = $age;
}
}
$teacher = new Person(true , "Henk" , "Barkhof" , 65);
$student = new Person(true , "Inge" , "Franzen" , 50);
[b] echo $teacher->??;
//echo $age->??;
[/b] ;
?>
</p>
</body>
</html>
930 views
hoe print ik de "teacher" en leeftijd ? Alvast bedankt.