Page 1 of 1

how to create a new function

Posted: Sat Jun 15, 2013 12:43 am
by kairya14
hello all,
i am new in php development,and i do not know hohw to make any function an any one told me how i will do this?

thanks in advance

Re: how to create a new function

Posted: Sat Jun 15, 2013 12:49 am
by pbs

Re: how to create a new function

Posted: Mon Jan 06, 2014 3:45 am
by uday.strad
LOL...
What sort of question is this .... you will always find this answer....although your new next time make sure you google these doubts....

Heres your answer....
<?php
function writeMsg()
{
echo "Hello world!";
}

writeMsg(); // call the function
?>

Re: how to create a new function

Posted: Mon Jul 28, 2014 5:37 am
by disha
Hi,
You should try this code to call any function
<?php
function foo($arg_1, $arg_2, /* ..., */ $arg_n)
{
echo "Example function.\n";
return $retval;
}
?>

Thanks I hope it will help you.