Home > Backend Development > PHP Tutorial > The problem of changing the variable value of the address of the Employment Guidance Center for College and Technical Secondary School Graduates in Tianjin in PHP reference address

The problem of changing the variable value of the address of the Employment Guidance Center for College and Technical Secondary School Graduates in Tianjin in PHP reference address

WBOY
Release: 2016-07-29 08:48:20
Original
1127 people have browsed it

Copy the code The code is as follows:


$foo = 'Bob'; // Assign 'Bob' to $foo
$bar = &$foo; // Reference $ through $bar foo
echo $foo.'
';
$bar = "My name is $bar"; // Modify the $bar variable
echo $bar.'
';
echo $ foo.'
'; // The value of $foo is also modified
?>


Output:
Bob
My name is Bob
My name is Bob
We see that the original value is indeed modified , occurs after the reference and assignment, but before the assignment, the original variable will not change

The above introduces the problem of changing the variable value of the address of the Tianjin College and Vocational School Graduates Employment Guidance Center in PHP, including the address of the Tianjin College and Vocational School Graduates Employment Guidance Center. I hope that friends who are interested in PHP tutorials can helped.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template