What is the function __construct used for?

I have been noticing __construct a lot with classes. I did a little reading and surfing the web, but I couldn’t find an explanation I could understand. I am just beginning with OOP.

I was wondering if someone could give me a general idea of what it is, and then a simple example of how it is used with PHP?

15 Answers
15

Leave a Comment