Variable variables and how to use illegal variable names

In PHP, the variable $45 is illegal, but if you use variable variables, you can use it. Here is an example,

<?php
$var_name = "45";

$$var_name = "this value will be stored in the 45 variable";

echo ${'45'};

As you can see, you must use curly bracket syntax to use illegal variables.

Page Comments (Click to edit)






[Click to add or edit comments])

Please prepend comments below including a date

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Have a nice day.