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
Related Posts
Useful PHP Functions and Codes for PHP Developers
15 December 2013Learnphp2PHP’s Built-In MYSQL Functions
21 August 2012Learnphp07 Useful functions to tighten the security in PHP
06 October 2010Learnphp6Function to rotate image in PHP
31 August 2010Learnphp0
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment