an example
$fruit = 'banana';$fruit is a variable when 'banana' is a string value for that variable. when we do echo $fruit, the result is 'banana'.
an example
$fruit = 'banana'; echo $fruit; //result : bananaThis is a static variable. How about when I want to create new variable in a run time?. You can do it by adding double dollar sign
an example
$fruit = 'banana'; $$fruit = 'durian'; echo $banana; //result : durian
You can download sample file : How to use variable variables in php
more information
0 comments:
Post a Comment