Hi,
$str='input_arr["username"]';
$input_arr=array();
$$str='abcd';
print_r($input_arr);
When I run the above code it only prints Array().
I expected it to print Array([username]=>'abcd')
What am I doing wrong?
This is in php 4 by the way.
Thanks a lot.
Edit:What am I trying to do?
$input_arr is supposed to be a static variable to hold validated user input.However, I only recently realised that php4.3 doesnt support self::$input_arr so I had to edit my script to bar($input_arr['name'],$value); so that I can save the value to a static variable in bar();since $input_arr['name'] does not exists in the current scope, I had to make it a string.