Question: what is the difference between function and method in php?
Answer: Method is actually a function used in the context of a class/object. When you create a function outside of a class/object, you can call it a function but when you create a function inside a class, you can call it a method. So an object can have methods (functions) and properties (variables).