Variable Variables

This lesson introduces variable variables, also called dynamic variables, and discusses how you can use them in PHP.

What are Variable Variables? #

Using PHP, we can access data through dynamic variable names. The name of a variable can be stored in another variable, allowing it to be accessed dynamically. Such variables are known as variable variables.

To turn a variable into a variable variable, you put an extra $ sign in front of your variable. This method is illustrated in the following figure:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy