Last active
September 28, 2017 11:26
-
-
Save platoosom/f5c7176f36cd93569263f86b20e2181f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class People { | |
public $cardID; | |
public $firstName; | |
public $lastName | |
public __construct() { | |
$this->cardID = '3-4512-22-213542'; | |
$this->firstName = 'Watcharamet'; | |
$this->lastName = 'Srinethirothai'; | |
} | |
private changeName($name) { | |
$this->firstName = $name; | |
} | |
public getFullName() { | |
return $this->firstName .' '. $this->lastName; | |
} | |
public setFirstName($name) { | |
$this->changeName($name); | |
} | |
} | |
$platoosom = new People(); | |
$platoosom->changeName('Warent'); | |
$name = $platoosom->getFullName(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment