Share on Google+Share on Google+

PHP Variable variables

This PHP tutorial describes about variable variables in PHP. Learn how to declare & how to use in class user variable variable in PHP etc.

PHP Variables variable:

Variables variable is a new kind of technique of using variables, in this technique we need to use more than one variable and we can use those variables dynamically.

As in the following examples we can see the use of variable variable both in general use as well as in OOP concept.

PHP Variables Variable Example:




echo "$a ${$a}";



Rose India




class foo


var $is="This is inside the class";



$o=new foo;

$m="my variable";

echo $o->is."<br/>";


echo $o->$bas[1]."<br/>";





This is inside the class
This is inside the class


Posted on: March 17, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.


Advertisement null