Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Variable Variables

Variable variables refer to a feature that allows to use the value of a variable as the name of another variable. It provides a way to dynamically create and access variables based on runtime values.

Variable variables are denoted by the double dollar sign $$ followed by the name of the variable stored in another variable. More dollar signs may be compounded, though it is rare.

<?php

$a = 'b';
$b = 'c';

echo $$b;

?>

Documentation

See Also