Again here....
I'm trying to learn PHP OOP (like in the last post), but as much as I read, I can not find the use of classes, methods and properties very well. So at the moment I don't find any sense to all of this. So I've thought it would be good to try to do an easy script using OOP to find why OOP is useful.
Would be the right exercise to do an script to calculate areas? Like... you choose circle, square or rectangle, then you add the height, width or ratio and it gives to the area in cm2. Would it be a script to practise OOP?
I'm so confused!!!! And internet is confusing me even more! If this is not a good idea... could anyone tell me a script where I can see I need to create properties.... initiate classes.... or mainly, can anyone suggest what script I could do being easy to follow and do step by step?
I've been practising with
class Cars {
public $color
public $brand
public $doors
}
To see how __construct, destruct and $this work, but I don't know what to do with it.... I mean.... in what case could I need to do this?
Thank you!