Home > Backend Development > PHP Tutorial > php $$Special variables (output the value of the variable string corresponding to the variable)

php $$Special variables (output the value of the variable string corresponding to the variable)

WBOY
Release: 2016-07-25 08:56:00
Original
1274 people have browsed it
  1. $var1 = 'nameOfVariable';
  2. $nameOfVariable = 'This is the value I want!';
  3. echo $$var1;
  4. ?>
Copy code

Output result:

This is the value I want!

Articles you may be interested in:

Detailed examples of variable variable safety in PHP The role of php variable $a{0} Learning examples about php variables About system variables and environment variables in php Example analysis of PHP variable references, function addresses and object references In-depth explanation of PHP functions and variable scope Summary of usage of PHP variable scope In-depth analysis of variable variable examples in PHP php super global variables list php variables and constants-php introductory tutorial (2) Analysis on the scope of application of php global variables Learn superglobal variables in php Example of using php global variable global About php’s super global variable array About PHP variable issues


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