see bewlow example:
<?php
class Employee {
private $first_name, $last_name;
public function getData($first_name, $last_name) {
$this->first_name = $first_name;
$this->last_name = $last_name;
}
public function printData() {
echo $this->first_name . " : " . $this->last_name;
}
}
$e1 = new Employee();
$e2 = new Employee();
?>
Sign up here with your email