PHP OOP 1
This is a series of notes that I've taken from the excellent "The Net Ninja" tutorials on youtube with regards to PHP OOP. Once an object is instantiated, the php…
Using PHP as an object based programming language
This is a series of notes that I've taken from the excellent "The Net Ninja" tutorials on youtube with regards to PHP OOP. Once an object is instantiated, the php…
<?php # person.class class Person{ var $name; # this is a property function set_name($new_name){ # this is a method $this->name=$new_name; } function get_name(){ # this is a method echo $this->name;…
<?php class Person{ // constructor public function __construct($first_name, $last_name) { $this->first_name = $first_name; $this->last_name = $last_name; } public function say_my_name() { echo "My name is " . $this->first_name . "…
<?php class Person{ // constructor public function __construct($first_name, $last_name) { $this->first_name = $first_name; $this->last_name = $last_name; } public function say_my_name() { echo "My name is " . $this->first_name . "…