What is the difference between a class and a function?
Difference between class and function
A class is something which usually gathers several of functions to structure up the code. A function is something to structure up your code so you can reuse it. Both these together provide a structure which helps decreasing redundancy and making coding alot easier.
It is very hard to explain briefly and I suggest you read this post when it comes to classes in php:
While not written for PHP, I've found this documentation to be very helpful for explaining how the concept works.
http://download.oracle.com/javase/tutorial/java/concepts/object.html
Res;10979471 wrote:While not written for PHP, I've found this documentation to be very helpful for explaining how the concept works.
http://download.oracle.com/javase/tutorial/java/concepts/object.html
+1