A function is just a name we give to a block of code that can be executed whenever we need it.
When you create a function you have give name for that, like "myfunction". It's with this function name that you will be able to call upon your function.
In PHP you can create the function by using the syntax
function myfunction()
{
....
... // some codes to be processed
...
}
Guidelines:
- Give the function a name that reflects what the function does
- The function name can start with a letter or underscore(not a number)
Example:
function myfunction()
{
echo "The function is executed";
}
echo "Here ";
writeName();
Thursday, December 31, 2009
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment