What are the parameters passed between php functions
This article mainly talks about "what are the parameters passed between php functions". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the parameters passed between php functions"?
Php: parameter passing between functions
1. Value transfer
The copy code is as follows:
Output result:
one
In Exam: 2
one
two。 Reference transfer
The copy code is as follows:
Output result:
one
In Exam: 2
two
3. Optional parameter
The copy code is as follows:
Function values ($price, $tax= "") {
$price + = $prive * $tax
Echo "Total Price:". $price. "
}
Values (100,0.25)
Values (100)
Output result:
Total Price: 125
Total Price: 100
4. If you pass in an object, you can change the value of that object
(in fact, the variable $obj records the handle to the object, passing in $obj as an argument, which makes it possible to manipulate the original object. )
The copy code is as follows:
Output result:
Mr. Zhan 12 male
Mr. Zhan 13 male
Mr. Zhan 14 male
At this point, I believe you have a deeper understanding of "what are the parameters passed between php functions?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!