MrSpock
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Downloads
Gallery
Store
Posts posted by MrSpock
-
-
I am following the tutorial on Object Oriented PHP (which is something I've always struggled to grasp) and I'm using __construct() throughout the tutorial. Can you explain it in layman's terms as I'm struggle to understand it?
For example:
class employee extends person { function __construct($employee_name) { $this->set_name($employee_name); } }
Why is the __construct() needed here?
Many thanks
Spock.
Php Construct
in PHP
Posted
so to use the classes above, using __construct() allows access to set_name and get_name when I call a new object of employee?
I'm still struggling to grasp it.