answersLogoWhite

0

A user defined function in PHP is set up of several key components.

First, the function keyword; this lets PHP know that you're setting up a function. Then the function name, which lets you later use your function. After that, the parametersthe function requires to operate. Finally, just the bracketssurrounding your function, setting it apart from the rest of your code.

function nameHere ($parameterOne, $parameterTwo) {

functionCodeHere();

}

User Avatar

Wiki User

7y ago

What else can I help you with?

Continue Learning about Basic Math
Related Questions

What does the php function eval?

The eval() function evaluates a string as PHP code. http://us.php.net/manual/en/function.eval.php


What is a PHP function?

Functions are basic blocks of code that work together. Functions can be used from the core PHP or can be created by users. To create a function, use the following syntax: function function_name(arg1, arg2, ... argX) { //Any valid php code here } To use a function, use the following syntax: function_name(arg1, arg2, ... argX);


How do you use a function with a button in PHP?

A simple function call <html> <body> <?php if(isset($_POST['button'])) { setValue(); // Function is called } function setValue() { echo "<br>The button property to call PHP function works"; // Your code here } ?> <input type="submit" name="button" onclick=<?php $_SERVER['PHP_SELF']; ?> /> </body> </head>


How do you create function in php?

they're called user-defined functions, this is the syntax: function the_user_defined_name() { the code you want here }


What is the correct way to create a function in php?

function myFunction($parameter1, $parameter2) { // this function's code goes here return $returnValue; // the value returned }


What is difference between php and ruby on rails?

PHP is a scripting language while Ruby on Rails is a framework based on ruby programming language. PHP is easy to learn and code while Ruby is hard to learn and code. PHP Code is a mess and difficult to find particular functions or code while ROR follows systematic development and you can easily find the required function.


How do you adjust php 5.3 code to make Wordpress Frugal website compatible with php 5.4?

Use PHP 5.4 version latest library .


What is the purpose of function in PHP program?

The function keyword in PHP allows users to define functions beyond those built into the language, like so: function isFour ($number) { return $number == 4; }Functions in any language, including PHP, allow the developer to re-use their code. Without functions all of the code required to do the simplest of tasks must be re-written constantly; but with functions you must only write the code once and then call it whenever needed.


How can one easily style a PHP code?

There are many ways that one could style a PHP code. One would first have to learn how to properly format PHP coding and use the C++ programming language to make it look nice.


What is a PHP file?

A PHP file is a text file containing code to be run on a webserver by a program called php. It's the most used dynamic page script engine as it is free and open source.Use the fopen() function to open files in PHP. The first parameter of this function is the file to be opened and the second parameter specifies in which mode the file should be opened


What are semantics in PHP?

PHP is related with HTML. HTML can be included into PHP script as well as PHP script can be included into HTML code. PHP begins and ends with <?php ?>. PHP is mix of few languages so semantics is mixed too.


How does PHP function in applications?

in php used for one typ website