already exists as an alternate
of this question.

exists and is an alternate of .

functions have independent existence means they are defined outside of the class e.g. in c main() is a function while methods do not have independent existence they are always defined inside class e.g. main() in Java is called method.

######## I've been studying OOP lately and had this question myself, so I will share my thoughts;

I was taught that "A Function should do 1(one) thing and do it well."

In specific Regards to PHP; The difference between a Method and a Function is that a Method is tied to a specific class.

Hope this helps.

-------------------------------------------------------------------------------------------------------- function can return value where as method can't that is the main difference between function and method

Actually you are describing the difference between a function and a procedure. Function returns a value, procedure does not unless you are using c#, then everything is a function.

In c# a function, to paraphrase the first answer, does and thing and does it well. A method contains functions. The most important method is the Main method. All functionality of a program must be referenced in the Main method because when you run a program, it starts at the beginning of the Main method, and stops wehn it hits end of the Main method.

Answer In an Object Oriented Programming (OOP) language like Java, it is called a method. In a procedural language (like QBASIC or PHP) it is c…alled a function. They are the same thing. Most people use them interchangeably. -DJ Craig A function returns a value and method does not return a value. A function that doesn't return a value is called (procedure / subroutine)

As per functionality both GET and POST methods were same.Difference is GET method will be showing the information information to the users.But in the case of POST method infor…mation will not be shown to the user. The data passed using the GET method would be visible to the user of the website in the browser address bar but when we pass the information using the POST method the data is not visible to the user directly. Also in GET method characters were restricted only to 256 characters.But in the case of POST method characters were not restricted. Get method will be visible to the user as it sended appended to the URL, put Post will not be visible as it is sent encapsulated within the HTTP request body. About the data type that can be send, with Get method you can only use text as it sent as a string appended with the URL, but with post is can text or binary. About form default, Get is the defualt method for any form, if you need to use the post method, you have to change the value of the attribute "method" to be Post. Get method has maximum length restricted to 256 characters as it is sent appended with the URL, but the Post method hasn't. Get method has limitataion in the size of data tranamitted, but post method hasn't.

Constructor will be automatically invoked when an object is created whereas method has to be called explicitly. Constructor needs to have the same name as that of the cla…ss whereas functions need not be the same. * There is no return type given in a constructor signature (header). The value is this object itself so there is no need to indicate a return value. * There is no return statement in the body of the constructor. * The first line of a constructor must either be a call on another constructor in the same class (using this), or a call on the superclass constructor (using super). If the first line is neither of these, the compiler automatically inserts a call to the parameterless super class constructor.

A method is simply a function that is defined for a class. To invoke it, you usually need to specify an object, or the class name, followed by a dot, followed by the method na…me. A method is simply a function that is defined for a class. To invoke it, you usually need to specify an object, or the class name, followed by a dot, followed by the method name. A method is simply a function that is defined for a class. To invoke it, you usually need to specify an object, or the class name, followed by a dot, followed by the method name. A method is simply a function that is defined for a class. To invoke it, you usually need to specify an object, or the class name, followed by a dot, followed by the method name.