SHARE
Facebook X Pinterest WhatsApp

PHPBuilder: Variable Variables, PHP, and You

Jul 20, 2010
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



“During a recent project I discovered a totally new concept in programming for myself, variable variables. I
needed to update multiple records from one page. After banging my head on the wall for quite some time,
I stumbled across the variable variable and all my troubles went away!”
So, just what the heck is a variable variable anyway? According to the PHP manual, a variable variable
takes the value of a variable and treats that as the name of a variable. While this may seem pretty
straightforward, it can be a little confusing with so many uses of the word variable in one sentence.
What the definition simply states is that you can set a variable — x equals this — and then set the variable variable,
meaning you set the value of x as a new variable of x. In this example, the variable this would equal is cake.

“So, just what the heck is a variable variable anyway? According to the PHP manual, a variable variable
takes the value of a variable and treats that as the name of a variable. While this may seem pretty
straightforward, it can be a little confusing with so many uses of the word “variable” in one sentence.
What the definition simply states is that you can set a variable — x equals this — and then set the variable variable,
meaning you set the value of x as a new variable of x. In this example, the variable this would equal is cake.”

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
What Is a Network Policy Server (NPS)? | Essential Guide
Virtual Servers vs. Physical Servers: Comparison and Use Cases
Ray Fernandez
Nov 14, 2023
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.