The example in this article tells you that PHP passes parameter usage by reference. Share to everyone for your reference, specific as follows:
Let's look at an example in a manual:
<?php
function Add_some_extra (& $string)//Introducing variables, using the same storage address
{
$string. = ' and something extra. '
}
$str = ' This is a string, ';
Add_some_extra ($STR);
echo $str; Outputs ' This is a string, and something extra. '
? >
Output:
This is a string, and something extra.
Without this & symbol,
<?php
function Add_some_extra ($string)
{
$string. = ' and something extra. ';
}
$str = ' This is a string, ';
Add_some_extra ($STR);
echo $str; Outputs ' This is a string, '
?>
Output:
More about PHP Interested readers can view the site topics: "PHP commonly used functions and skills summary", "PHP object-oriented Program Design Introductory Course", "PHP Mathematical Arithmetic Skills summary", "PHP Array" operation Skills Encyclopedia, "PHP Data structure and algorithm tutorial", " PHP Programming algorithm Summary, "PHP Regular Expression Usage summary" and "PHP common database Operation skill Summary"
I hope this article will help you with the PHP program design.