Welcome visitors of MIC Computer

Welcome to my blog. With this blog you can post your question about computer and programming for absolutely free (free consultation sponsored by MIC Computer).. Well what are you waiting for just feel free to post your question or share with me about your computer / programming experience

Monday, October 10, 2011

PHP Procedure and Function I

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)
{
echo(message);
}
the above example is a PHP procedure. Althougt you see that the declaration is function :). This is the example of PHP function.
function hello(message)
{
return("my message is " . 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..

No comments: