PHP5 Class Object Simple Tutorial




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();

?>
Previous
Next Post »
Show Comments: OR

2 comments

Write comments