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)

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Powered by pmwiki-2.2.0-beta65