Every object oriented programming (OOP) should need a procedure and function. PHP is also OOP so it also need procedure and function. To declare a procedure or function, we have a same format
function hello(message)the above example is a PHP procedure. Althougt you see that the declaration is function :). This is the example of PHP function.
{
echo(message);
}
function hello(message)this is a PHP function, can you see the different? Yes you are right. The different is there is return statement as a return value on PHP function. That's all..
{
return("my message is " . message);
}
No comments:
Post a Comment