iSelfSchooling.com - Since 1999  References  |  Job Openings  |
    Home  | Search more  | Oracle Syntax  | Instructor-Led in Class   | (Members to access to VIDEOS)
 

Copyright & User Agreement

   Suggestions Email2aFriendHomepage us! |  Bookmark

Services

  Vision/Mission

  Services

  Biography

  Contact Us

 FREE Training

  Start...

  SQL

  PL/SQL

  Forms 

  Reports

  DBA Fundamentals

  Performance

  Prepare for OCP

  ShareUrNotes

...

  Acknowledgement

  Who is who

  University Directory

  Links...

 

 

 

How to create and call a function in PHP that takes arguments or parameter?

More Resources by Google:

How to create and call a function in PHP that takes arguments or parameter?

The following is the syntax that creates a function:
function function_name ($arg1, $arg2, …) {
statement(s); // statements in the function

Return $variable;
}

// example of returning multiple values…
function function_name ($arg1, $arg2, …) {
statement(s); // statements in the function

Return array( $value1, $value2, …);
}


// example of using global variable…
// The global variable exists outside of the function, it
// also have the same value within the function.
function function_name ($arg1, $arg2, …) {
global $variable;
statement(s); // statements in the function

Return array( $value1, $value2, …);
}

The following is the syntax that calls a function:
function_name($variable1, $variable2, …);
-- or -- 
function_name(‘literal value1’, ‘literal value2’, …);
-- or --
function_name(‘mixed literals and variables’, $variable, …);

 

 

 
 
Google
 
Web web site