1. Home
  2. Computing & Technology
  3. PHP / MySQL
photo of Angela Bradley
Angela's PHP / MySQL Blog

By Angela Bradley, About.com Guide to PHP / MySQL

Variables from Text

Friday April 7, 2006
If you've ever tried to create a PHP variable on the fly only to have it end up functioning as text and not code, you simply need to put it inside of {} brackets. This allows you to call a variable within a variable, and works well when working inside loops.
Comments
April 8, 2006 at 2:06 pm
(1) Freddie says:

This is just awesomeness! Its helped me no end, even a total a newb could understand this!

Great Work, and thanks :D

April 4, 2007 at 3:45 pm
(2) Josh says:

You actually don’t even need the {}. Simply using $$primary works.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL

©2009 About.com, a part of The New York Times Company.

All rights reserved.