Tools, FAQ, Tutorials:
Passing an Argument to a Function in PHP
How To Pass an Argument to a Function? in PHP?
✍: FYIcenter.com
To pass an argument to a function, you need to:
Here is a PHP script on how to use arguments in a function():
<?php
function f2c($f) {
return ($f - 32.0)/1.8;
}
print("Celsius: ".f2c(100.0)."\n");
print("Celsius: ".f2c(-40.0)."\n");
?>
This script will print:
Celsius: 37.777777777778 Celsius: -40
⇒ Variables Are Passed by Values in PHP
⇐ Returning a Value from a Function in PHP
2016-12-24, ∼2527🔥, 0💬
Popular Posts:
Where to get the detailed description of the JSON.stringify() Function in JavaScript? Here is the de...
How to convert JSON Objects to PHP Associative Arrays using the json_decode() function? Actually, JS...
What properties and functions are supported on requests.models.Response objects? "requests" module s...
How to use the "Ctrl-p Ctrl-q" sequence to detach console from the TTY terminal of container's runni...
How to use the urllib.request.Request object to build more complex HTTP request? The urllib.request....