Created
September 28, 2017 11:13
-
-
Save platoosom/3e20e6f6732ffd1afae7a8a8540a0ceb 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 | |
publict __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(); | |
$name = $platoosom->getFullName(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment