Home >> PHP - MySQL Creasting Dynamic Web Sites 3.1 [Page 2] Article by: Shelton Manage Tuesday, 09th June, 2009
Creating and calling own functions
PHP has a lot of built-in functions for every needs. More capabilty for you to define and use your own functions for whatever wpecific purpose. The syntax is making own function is: function function_name() { // Funtion code. }
The name of your own fuction can be any combination of letters, numbers and the underscore.
To create own functions
dateform.phps | dateform.php
aa
Creating function that takes argument
A function can take any number of arguments that you choose, but the order in which you put them is critixal. For your arguments, use variable names:
function function_name ($arg1, $arg2) { // Function code. }
To call function use function_name ('value', 'more values'); function_name ('valu', '$var');
To write function that takes argument
calculator.phps | calculator.php | handle_calculator.phps | handle_calculator.php
Page: First - 1 2 3 4 - Last
|