The difference between passing parameters in PHP and passing parameters. Differences between passing parameter values and passing parameters in PHP differences between passing parameter values and passing parameters in PHP this article mainly introduces the differences between passing parameter values and passing parameters in PHP, it is very simple. The difference between passing parameters and passing parameters through PHP is simple.
Differences between passing parameters in PHP and passing parameters
This article mainly introduces the differences between passing parameter values in PHP and passing parameters, which is very simple. you can see through simple comparison of examples. if you need it, you can refer to it.
Let's talk about the code.
?
1 2 3 |
Function test (& val ){ Return $ val; } |
What are the advantages of using & for parameter passing?
Address transfer allows changes within the function, for example:
?
1 2 3 4 5 6 7 |
$ Test = "hello "; Function myFun (& $ val ){ $ Val = "hello world "; Return $ val; } Echo myFun (& $ test); // hello world Echo $ test; // hello world |
The above is all the content of this article. I hope you will like it.
Differences between passing parameters in PHP and passing parameters...