welcomewiki has just posted in the PHP Forum forum of Wiki Newforum under the title of PHP Functions.
This thread is located at http://www.wikinewforum.com/showthread.php?t=5858
Here is the message that has just been posted:
***************
*Use a PHP Function*
Now we will use the function in a PHP script:
<html>
<body> <?php
function writeMyName()
{
echo "Kai Jim Refsnes";
} echo "Hello world!<br />";
echo "My name is ";
writeMyName();
echo ".<br />That's right, ";
writeMyName();
echo " is my name.";
?> </body>
</html> The output of the code above will be:
Hello world!
My name is Kai Jim Refsnes.
That's right, Kai Jim Refsnes is my name.
*PHP Functions - Adding parameters*
Our first function (writeMyName()) is a very simple function. It only writes a static string.
To add more functionality to a function, we can add parameters. A parameter is just like a variable.
You may have noticed the parentheses after the function name, like: writeMyName(). The parameters are specified inside the parentheses.
***************