answersLogoWhite

0


Best Answer

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

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What lines of code make up a function in php?
Write your answer...
Submit
Still have questions?
magnify glass
imp
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.